Drop AbstractLazyResolveDescriptorRendererTest with DescriptorRendererTest refactoring
This commit is contained in:
-171
@@ -1,171 +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.google.common.collect.Lists;
|
|
||||||
import com.intellij.openapi.editor.Document;
|
|
||||||
import com.intellij.openapi.editor.impl.DocumentImpl;
|
|
||||||
import com.intellij.openapi.util.io.FileUtil;
|
|
||||||
import com.intellij.psi.PsiElement;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.jet.ConfigurationKind;
|
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
|
||||||
import org.jetbrains.jet.context.ContextPackage;
|
|
||||||
import org.jetbrains.jet.context.GlobalContextImpl;
|
|
||||||
import org.jetbrains.jet.di.InjectorForLazyResolve;
|
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
|
||||||
import org.jetbrains.jet.lang.descriptors.impl.ModuleDescriptorImpl;
|
|
||||||
import org.jetbrains.jet.lang.psi.*;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingTraceContext;
|
|
||||||
import org.jetbrains.jet.lang.resolve.java.TopDownAnalyzerFacadeForJVM;
|
|
||||||
import org.jetbrains.jet.lang.resolve.kotlin.JavaDeclarationCheckerProvider;
|
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.declarations.FileBasedDeclarationProviderFactory;
|
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
|
||||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
|
||||||
import org.jetbrains.jet.renderer.DescriptorRenderer;
|
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory;
|
|
||||||
|
|
||||||
public abstract class AbstractLazyResolveDescriptorRendererTest extends KotlinTestWithEnvironment {
|
|
||||||
@Override
|
|
||||||
protected JetCoreEnvironment createEnvironment() {
|
|
||||||
return createEnvironmentWithMockJdk(ConfigurationKind.ALL);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected DeclarationDescriptor getDescriptor(JetDeclaration declaration, ResolveSession resolveSession) {
|
|
||||||
return resolveSession.resolveToDescriptor(declaration);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void doTest(@NotNull String testFile) throws IOException {
|
|
||||||
String fileText = FileUtil.loadFile(new File(testFile), true);
|
|
||||||
|
|
||||||
JetFile psiFile = JetPsiFactory(getProject()).createFile(fileText);
|
|
||||||
Collection<JetFile> files = Lists.newArrayList(psiFile);
|
|
||||||
|
|
||||||
final ModuleDescriptorImpl lazyModule = TopDownAnalyzerFacadeForJVM.createJavaModule("<lazy module>");
|
|
||||||
lazyModule.addDependencyOnModule(lazyModule);
|
|
||||||
lazyModule.addDependencyOnModule(KotlinBuiltIns.getInstance().getBuiltInsModule());
|
|
||||||
lazyModule.seal();
|
|
||||||
GlobalContextImpl globalContext = ContextPackage.GlobalContext();
|
|
||||||
final ResolveSession resolveSession = new InjectorForLazyResolve(
|
|
||||||
getProject(), globalContext, lazyModule,
|
|
||||||
new FileBasedDeclarationProviderFactory(globalContext.getStorageManager(), files),
|
|
||||||
new BindingTraceContext(),
|
|
||||||
JavaDeclarationCheckerProvider.INSTANCE$).getResolveSession();
|
|
||||||
lazyModule.initialize(resolveSession.getPackageFragmentProvider());
|
|
||||||
|
|
||||||
final List<DeclarationDescriptor> descriptors = new ArrayList<DeclarationDescriptor>();
|
|
||||||
psiFile.accept(new JetVisitorVoid() {
|
|
||||||
@Override
|
|
||||||
public void visitJetFile(@NotNull JetFile file) {
|
|
||||||
FqName fqName = file.getPackageFqName();
|
|
||||||
if (!fqName.isRoot()) {
|
|
||||||
PackageViewDescriptor packageDescriptor = lazyModule.getPackage(fqName);
|
|
||||||
descriptors.add(packageDescriptor);
|
|
||||||
}
|
|
||||||
file.acceptChildren(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void visitClassObject(@NotNull JetClassObject classObject) {
|
|
||||||
classObject.acceptChildren(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void visitParameter(@NotNull JetParameter parameter) {
|
|
||||||
PsiElement declaringElement = parameter.getParent().getParent();
|
|
||||||
if (declaringElement instanceof JetFunctionType) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (declaringElement instanceof JetNamedFunction) {
|
|
||||||
JetNamedFunction jetNamedFunction = (JetNamedFunction) declaringElement;
|
|
||||||
FunctionDescriptor functionDescriptor = (FunctionDescriptor) getDescriptor(jetNamedFunction, resolveSession);
|
|
||||||
addCorrespondingParameterDescriptor(functionDescriptor, parameter);
|
|
||||||
}
|
|
||||||
else if (declaringElement instanceof JetClass) {
|
|
||||||
// Primary constructor parameter
|
|
||||||
JetClass jetClass = (JetClass) declaringElement;
|
|
||||||
ClassDescriptor classDescriptor = (ClassDescriptor) getDescriptor(jetClass, resolveSession);
|
|
||||||
addCorrespondingParameterDescriptor(classDescriptor.getConstructors().iterator().next(), parameter);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
super.visitParameter(parameter);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void addCorrespondingParameterDescriptor(FunctionDescriptor functionDescriptor, JetParameter parameter) {
|
|
||||||
for (ValueParameterDescriptor valueParameterDescriptor : functionDescriptor.getValueParameters()) {
|
|
||||||
if (valueParameterDescriptor.getName().equals(parameter.getNameAsName())) {
|
|
||||||
descriptors.add(valueParameterDescriptor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
parameter.acceptChildren(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void visitPropertyAccessor(@NotNull JetPropertyAccessor accessor) {
|
|
||||||
JetProperty parent = (JetProperty) accessor.getParent();
|
|
||||||
PropertyDescriptor propertyDescriptor = (PropertyDescriptor) getDescriptor(parent, resolveSession);
|
|
||||||
if (accessor.isGetter()) {
|
|
||||||
descriptors.add(propertyDescriptor.getGetter());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
descriptors.add(propertyDescriptor.getSetter());
|
|
||||||
}
|
|
||||||
accessor.acceptChildren(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void visitAnonymousInitializer(@NotNull JetClassInitializer initializer) {
|
|
||||||
initializer.acceptChildren(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void visitDeclaration(@NotNull JetDeclaration element) {
|
|
||||||
DeclarationDescriptor descriptor = getDescriptor(element, resolveSession);
|
|
||||||
descriptors.add(descriptor);
|
|
||||||
if (descriptor instanceof ClassDescriptor) {
|
|
||||||
descriptors.addAll(((ClassDescriptor) descriptor).getConstructors());
|
|
||||||
}
|
|
||||||
element.acceptChildren(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void visitJetElement(@NotNull JetElement element) {
|
|
||||||
element.acceptChildren(this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
StringBuilder renderedDescriptors = new StringBuilder();
|
|
||||||
for (DeclarationDescriptor descriptor : descriptors) {
|
|
||||||
if (renderedDescriptors.length() != 0) {
|
|
||||||
renderedDescriptors.append("\n");
|
|
||||||
}
|
|
||||||
renderedDescriptors.append(DescriptorRenderer.FQ_NAMES_IN_TYPES.render(descriptor));
|
|
||||||
}
|
|
||||||
|
|
||||||
Document document = new DocumentImpl(psiFile.getText());
|
|
||||||
assertEquals(JetTestUtils.getLastCommentedLines(document), renderedDescriptors.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
/*
|
||||||
|
* 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.renderer
|
||||||
|
|
||||||
|
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor
|
||||||
|
import org.jetbrains.jet.lang.psi.JetVisitorVoid
|
||||||
|
import org.jetbrains.jet.lang.psi.JetElement
|
||||||
|
import org.jetbrains.jet.lang.descriptors.ClassDescriptor
|
||||||
|
import com.intellij.openapi.editor.impl.DocumentImpl
|
||||||
|
import org.jetbrains.jet.JetTestUtils
|
||||||
|
import java.util.ArrayList
|
||||||
|
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment
|
||||||
|
import org.jetbrains.jet.ConfigurationKind
|
||||||
|
import com.intellij.testFramework.UsefulTestCase
|
||||||
|
import java.io.File
|
||||||
|
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession
|
||||||
|
import org.jetbrains.jet.lang.psi.JetDeclaration
|
||||||
|
import org.jetbrains.jet.lang.resolve.java.TopDownAnalyzerFacadeForJVM
|
||||||
|
import org.jetbrains.jet.context.GlobalContext
|
||||||
|
import org.jetbrains.jet.di.InjectorForLazyResolve
|
||||||
|
import org.jetbrains.jet.lang.resolve.lazy.declarations.FileBasedDeclarationProviderFactory
|
||||||
|
import org.jetbrains.jet.cli.jvm.compiler.CliLightClassGenerationSupport
|
||||||
|
import org.jetbrains.jet.lang.resolve.kotlin.JavaDeclarationCheckerProvider
|
||||||
|
import org.jetbrains.jet.lang.psi.JetFile
|
||||||
|
import org.jetbrains.jet.lang.psi.JetClassObject
|
||||||
|
import org.jetbrains.jet.lang.psi.JetParameter
|
||||||
|
import org.jetbrains.jet.lang.psi.JetFunctionType
|
||||||
|
import org.jetbrains.jet.lang.psi.JetNamedFunction
|
||||||
|
import org.jetbrains.jet.lang.psi.JetClass
|
||||||
|
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor
|
||||||
|
import org.jetbrains.jet.lang.psi.JetPropertyAccessor
|
||||||
|
import org.jetbrains.jet.lang.psi.JetProperty
|
||||||
|
import org.jetbrains.jet.lang.descriptors.PropertyDescriptor
|
||||||
|
import org.jetbrains.jet.lang.psi.JetClassInitializer
|
||||||
|
import org.jetbrains.jet.lang.resolve.lazy.KotlinTestWithEnvironment
|
||||||
|
import com.intellij.openapi.util.io.FileUtil
|
||||||
|
import org.jetbrains.jet.lang.psi.JetPsiFactory
|
||||||
|
|
||||||
|
public abstract class AbstractDescriptorRendererTest : KotlinTestWithEnvironment() {
|
||||||
|
protected open fun getDescriptor(declaration: JetDeclaration, resolveSession: ResolveSession): DeclarationDescriptor {
|
||||||
|
return resolveSession.resolveToDescriptor(declaration)
|
||||||
|
}
|
||||||
|
|
||||||
|
public fun doTest(path: String) {
|
||||||
|
val fileText = FileUtil.loadFile(File(path), true)
|
||||||
|
val psiFile = JetPsiFactory(getProject()).createFile(fileText)
|
||||||
|
|
||||||
|
val lazyModule = TopDownAnalyzerFacadeForJVM.createSealedJavaModule()
|
||||||
|
val globalContext = GlobalContext()
|
||||||
|
|
||||||
|
val resolveSession = InjectorForLazyResolve(
|
||||||
|
getProject(), globalContext, lazyModule,
|
||||||
|
FileBasedDeclarationProviderFactory(globalContext.storageManager, listOf(psiFile)),
|
||||||
|
CliLightClassGenerationSupport.NoScopeRecordCliBindingTrace(),
|
||||||
|
JavaDeclarationCheckerProvider).getResolveSession()
|
||||||
|
|
||||||
|
lazyModule.initialize(resolveSession.getPackageFragmentProvider())
|
||||||
|
|
||||||
|
val descriptors = ArrayList<DeclarationDescriptor>()
|
||||||
|
|
||||||
|
psiFile.accept(object : JetVisitorVoid() {
|
||||||
|
override fun visitJetFile(file: JetFile) {
|
||||||
|
val fqName = file.getPackageFqName()
|
||||||
|
if (!fqName.isRoot()) {
|
||||||
|
val packageDescriptor = lazyModule.getPackage(fqName)
|
||||||
|
descriptors.add(packageDescriptor)
|
||||||
|
}
|
||||||
|
file.acceptChildren(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitClassObject(classObject: JetClassObject) {
|
||||||
|
classObject.acceptChildren(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitParameter(parameter: JetParameter) {
|
||||||
|
val declaringElement = parameter.getParent().getParent()
|
||||||
|
when (declaringElement) {
|
||||||
|
is JetFunctionType -> return
|
||||||
|
is JetNamedFunction ->
|
||||||
|
addCorrespondingParameterDescriptor(getDescriptor(declaringElement, resolveSession) as FunctionDescriptor, parameter)
|
||||||
|
is JetClass -> {
|
||||||
|
val jetClass: JetClass = declaringElement
|
||||||
|
val classDescriptor = getDescriptor(jetClass, resolveSession) as ClassDescriptor
|
||||||
|
addCorrespondingParameterDescriptor(classDescriptor.getConstructors().first(), parameter)
|
||||||
|
}
|
||||||
|
else -> super.visitParameter(parameter)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitPropertyAccessor(accessor: JetPropertyAccessor) {
|
||||||
|
val parent = accessor.getParent() as JetProperty
|
||||||
|
val propertyDescriptor = getDescriptor(parent, resolveSession) as PropertyDescriptor
|
||||||
|
if (accessor.isGetter()) {
|
||||||
|
descriptors.add(propertyDescriptor.getGetter())
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
descriptors.add(propertyDescriptor.getSetter())
|
||||||
|
}
|
||||||
|
accessor.acceptChildren(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitAnonymousInitializer(initializer: JetClassInitializer) {
|
||||||
|
initializer.acceptChildren(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitDeclaration(element: JetDeclaration) {
|
||||||
|
val descriptor = getDescriptor(element, resolveSession)
|
||||||
|
descriptors.add(descriptor)
|
||||||
|
if (descriptor is ClassDescriptor) {
|
||||||
|
descriptors.addAll(descriptor.getConstructors())
|
||||||
|
}
|
||||||
|
element.acceptChildren(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun visitJetElement(element: JetElement) {
|
||||||
|
element.acceptChildren(this)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun addCorrespondingParameterDescriptor(functionDescriptor: FunctionDescriptor, parameter: JetParameter) {
|
||||||
|
for (valueParameterDescriptor in functionDescriptor.getValueParameters()) {
|
||||||
|
if (valueParameterDescriptor.getName() == parameter.getNameAsName()) {
|
||||||
|
descriptors.add(valueParameterDescriptor)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parameter.acceptChildren(this)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
val renderedDescriptors = descriptors.map { DescriptorRenderer.FQ_NAMES_IN_TYPES.render(it) }.joinToString(separator = "\n")
|
||||||
|
|
||||||
|
val document = DocumentImpl(psiFile.getText())
|
||||||
|
UsefulTestCase.assertSameLines(JetTestUtils.getLastCommentedLines(document), renderedDescriptors.toString())
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun createEnvironment(): JetCoreEnvironment {
|
||||||
|
return createEnvironmentWithMockJdk(ConfigurationKind.JDK_ONLY)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1,133 +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.renderer;
|
|
||||||
|
|
||||||
import com.intellij.openapi.editor.Document;
|
|
||||||
import com.intellij.openapi.editor.impl.DocumentImpl;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.jet.ConfigurationKind;
|
|
||||||
import org.jetbrains.jet.JetLiteFixture;
|
|
||||||
import org.jetbrains.jet.JetTestCaseBuilder;
|
|
||||||
import org.jetbrains.jet.JetTestUtils;
|
|
||||||
import org.jetbrains.jet.analyzer.AnalysisResult;
|
|
||||||
import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment;
|
|
||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor;
|
|
||||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
|
||||||
import org.jetbrains.jet.lang.descriptors.PackageViewDescriptor;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetElement;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetFile;
|
|
||||||
import org.jetbrains.jet.lang.psi.JetVisitorVoid;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.JvmResolveUtil;
|
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class DescriptorRendererTest extends JetLiteFixture {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected JetCoreEnvironment createEnvironment() {
|
|
||||||
return createEnvironmentWithMockJdk(ConfigurationKind.JDK_ONLY);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testGlobalProperties() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testGlobalFunctions() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testClasses() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testEnum() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testUnitType() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFunctionTypes() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testErrorType() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testInheritedMembersVisibility() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testKeywordsInNames() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void testFunctionTypesInSignature() throws IOException {
|
|
||||||
doTest();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getTestDataPath() {
|
|
||||||
return JetTestCaseBuilder.getTestDataPathBase() + "/renderer";
|
|
||||||
}
|
|
||||||
|
|
||||||
private void doTest() throws IOException {
|
|
||||||
String fileName = getTestName(false) + ".kt";
|
|
||||||
JetFile psiFile = createPsiFile(null, fileName, loadFile(fileName));
|
|
||||||
AnalysisResult analysisResult =
|
|
||||||
JvmResolveUtil.analyzeOneFileWithJavaIntegration(psiFile);
|
|
||||||
final BindingContext bindingContext = analysisResult.getBindingContext();
|
|
||||||
final List<DeclarationDescriptor> descriptors = new ArrayList<DeclarationDescriptor>();
|
|
||||||
|
|
||||||
FqName fqName = psiFile.getPackageFqName();
|
|
||||||
if (!fqName.isRoot()) {
|
|
||||||
PackageViewDescriptor packageDescriptor = analysisResult.getModuleDescriptor().getPackage(fqName);
|
|
||||||
descriptors.add(packageDescriptor);
|
|
||||||
}
|
|
||||||
|
|
||||||
psiFile.acceptChildren(new JetVisitorVoid() {
|
|
||||||
@Override
|
|
||||||
public void visitJetElement(@NotNull JetElement element) {
|
|
||||||
DeclarationDescriptor descriptor = bindingContext.get(BindingContext.DECLARATION_TO_DESCRIPTOR, element);
|
|
||||||
if (descriptor != null) {
|
|
||||||
descriptors.add(descriptor);
|
|
||||||
if (descriptor instanceof ClassDescriptor) {
|
|
||||||
descriptors.addAll(((ClassDescriptor) descriptor).getConstructors());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
element.acceptChildren(this);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
StringBuilder renderedDescriptors = new StringBuilder();
|
|
||||||
for (DeclarationDescriptor descriptor : descriptors) {
|
|
||||||
if (renderedDescriptors.length() != 0) {
|
|
||||||
renderedDescriptors.append("\n");
|
|
||||||
}
|
|
||||||
renderedDescriptors.append(DescriptorRenderer.FQ_NAMES_IN_TYPES.render(descriptor));
|
|
||||||
}
|
|
||||||
|
|
||||||
Document document = new DocumentImpl(psiFile.getText());
|
|
||||||
assertSameLines(JetTestUtils.getLastCommentedLines(document), renderedDescriptors.toString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-2
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package org.jetbrains.jet.lang.resolve.lazy;
|
package org.jetbrains.jet.renderer;
|
||||||
|
|
||||||
import com.intellij.testFramework.TestDataPath;
|
import com.intellij.testFramework.TestDataPath;
|
||||||
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
import org.jetbrains.jet.JUnit3RunnerWithInners;
|
||||||
@@ -31,7 +31,7 @@ import java.util.regex.Pattern;
|
|||||||
@TestMetadata("compiler/testData/renderer")
|
@TestMetadata("compiler/testData/renderer")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public class LazyResolveDescriptorRendererTestGenerated extends AbstractLazyResolveDescriptorRendererTest {
|
public class DescriptorRendererTestGenerated extends AbstractDescriptorRendererTest {
|
||||||
public void testAllFilesPresentInRenderer() throws Exception {
|
public void testAllFilesPresentInRenderer() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/renderer"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/renderer"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,6 @@ import org.jetbrains.jet.codegen.defaultConstructor.AbstractDefaultArgumentsRefl
|
|||||||
import org.jetbrains.jet.jvm.compiler.AbstractLoadJavaTest
|
import org.jetbrains.jet.jvm.compiler.AbstractLoadJavaTest
|
||||||
import org.jetbrains.jet.jvm.compiler.AbstractCompileJavaAgainstKotlinTest
|
import org.jetbrains.jet.jvm.compiler.AbstractCompileJavaAgainstKotlinTest
|
||||||
import org.jetbrains.jet.jvm.compiler.AbstractCompileKotlinAgainstKotlinTest
|
import org.jetbrains.jet.jvm.compiler.AbstractCompileKotlinAgainstKotlinTest
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRendererTest
|
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveRecursiveComparingTest
|
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveRecursiveComparingTest
|
||||||
import org.jetbrains.jet.modules.xml.AbstractModuleXmlParserTest
|
import org.jetbrains.jet.modules.xml.AbstractModuleXmlParserTest
|
||||||
import org.jetbrains.jet.jvm.compiler.AbstractWriteSignatureTest
|
import org.jetbrains.jet.jvm.compiler.AbstractWriteSignatureTest
|
||||||
@@ -81,7 +80,7 @@ import org.jetbrains.jet.plugin.conversion.copy.AbstractJavaToKotlinCopyPasteCon
|
|||||||
import org.jetbrains.jet.shortenRefs.AbstractShortenRefsTest
|
import org.jetbrains.jet.shortenRefs.AbstractShortenRefsTest
|
||||||
import org.jetbrains.jet.completion.handlers.AbstractSmartCompletionHandlerTest
|
import org.jetbrains.jet.completion.handlers.AbstractSmartCompletionHandlerTest
|
||||||
import org.jetbrains.jet.generators.tests.generator.TestGeneratorUtil
|
import org.jetbrains.jet.generators.tests.generator.TestGeneratorUtil
|
||||||
import org.jetbrains.jet.resolve.AbstractAdditionalLazyResolveDescriptorRendererTest
|
import org.jetbrains.jet.resolve.AbstractAdditionalResolveDescriptorRendererTest
|
||||||
import org.jetbrains.jet.resolve.AbstractReferenceResolveInLibrarySourcesTest
|
import org.jetbrains.jet.resolve.AbstractReferenceResolveInLibrarySourcesTest
|
||||||
import org.jetbrains.jet.resolve.constraintSystem.AbstractConstraintSystemTest
|
import org.jetbrains.jet.resolve.constraintSystem.AbstractConstraintSystemTest
|
||||||
import org.jetbrains.jet.completion.AbstractCompiledKotlinInJavaCompletionTest
|
import org.jetbrains.jet.completion.AbstractCompiledKotlinInJavaCompletionTest
|
||||||
@@ -107,7 +106,7 @@ import org.jetbrains.jet.plugin.debugger.evaluate.AbstractKotlinEvaluateExpressi
|
|||||||
import org.jetbrains.jet.plugin.debugger.evaluate.AbstractSelectExpressionForDebuggerTest
|
import org.jetbrains.jet.plugin.debugger.evaluate.AbstractSelectExpressionForDebuggerTest
|
||||||
import org.jetbrains.jet.plugin.debugger.evaluate.AbstractCodeFragmentCompletionTest
|
import org.jetbrains.jet.plugin.debugger.evaluate.AbstractCodeFragmentCompletionTest
|
||||||
import org.jetbrains.jet.plugin.debugger.evaluate.AbstractCodeFragmentHighlightingTest
|
import org.jetbrains.jet.plugin.debugger.evaluate.AbstractCodeFragmentHighlightingTest
|
||||||
import org.jetbrains.jet.plugin.stubs.AbstractLazyResolveByStubTest
|
import org.jetbrains.jet.plugin.stubs.AbstractResolveByStubTest
|
||||||
import org.jetbrains.jet.plugin.stubs.AbstractMultiFileHighlightingTest
|
import org.jetbrains.jet.plugin.stubs.AbstractMultiFileHighlightingTest
|
||||||
import org.jetbrains.jet.cfg.AbstractPseudoValueTest
|
import org.jetbrains.jet.cfg.AbstractPseudoValueTest
|
||||||
import org.jetbrains.jet.plugin.structureView.AbstractKotlinFileStructureTest
|
import org.jetbrains.jet.plugin.structureView.AbstractKotlinFileStructureTest
|
||||||
@@ -132,6 +131,7 @@ import org.jetbrains.jet.completion.AbstractMultiFileSmartCompletionTest
|
|||||||
import org.jetbrains.jet.completion.handlers.AbstractCompletionCharFilterTest
|
import org.jetbrains.jet.completion.handlers.AbstractCompletionCharFilterTest
|
||||||
import org.jetbrains.jet.resolve.AbstractPartialBodyResolveTest
|
import org.jetbrains.jet.resolve.AbstractPartialBodyResolveTest
|
||||||
import org.jetbrains.jet.checkers.AbstractJetDiagnosticsTestWithJsStdLib
|
import org.jetbrains.jet.checkers.AbstractJetDiagnosticsTestWithJsStdLib
|
||||||
|
import org.jetbrains.jet.renderer.AbstractDescriptorRendererTest
|
||||||
import org.jetbrains.jet.types.AbstractJetTypeBindingTest
|
import org.jetbrains.jet.types.AbstractJetTypeBindingTest
|
||||||
import org.jetbrains.jet.plugin.debugger.evaluate.AbstractCodeFragmentCompletionHandlerTest
|
import org.jetbrains.jet.plugin.debugger.evaluate.AbstractCodeFragmentCompletionHandlerTest
|
||||||
|
|
||||||
@@ -245,7 +245,7 @@ fun main(args: Array<String>) {
|
|||||||
model("compileKotlinAgainstKotlin", extension = "A.kt")
|
model("compileKotlinAgainstKotlin", extension = "A.kt")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass(javaClass<AbstractLazyResolveDescriptorRendererTest>()) {
|
testClass(javaClass<AbstractDescriptorRendererTest>()) {
|
||||||
model("renderer")
|
model("renderer")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ fun main(args: Array<String>) {
|
|||||||
model("typeSubstitution", extension = "java")
|
model("typeSubstitution", extension = "java")
|
||||||
}
|
}
|
||||||
|
|
||||||
testClass(javaClass<AbstractAdditionalLazyResolveDescriptorRendererTest>()) {
|
testClass(javaClass<AbstractAdditionalResolveDescriptorRendererTest>()) {
|
||||||
model("resolve/additionalLazyResolve")
|
model("resolve/additionalLazyResolve")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -647,7 +647,7 @@ fun main(args: Array<String>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testGroup("idea/tests", "compiler/testData") {
|
testGroup("idea/tests", "compiler/testData") {
|
||||||
testClass(javaClass<AbstractLazyResolveByStubTest>()) {
|
testClass(javaClass<AbstractResolveByStubTest>()) {
|
||||||
model("loadJava/compiledKotlin")
|
model("loadJava/compiledKotlin")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ import java.io.File;
|
|||||||
import static com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel;
|
import static com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel;
|
||||||
import static org.jetbrains.jet.test.util.DescriptorValidator.ValidationVisitor.errorTypesForbidden;
|
import static org.jetbrains.jet.test.util.DescriptorValidator.ValidationVisitor.errorTypesForbidden;
|
||||||
|
|
||||||
public abstract class AbstractLazyResolveByStubTest extends KotlinCodeInsightTestCase {
|
public abstract class AbstractResolveByStubTest extends KotlinCodeInsightTestCase {
|
||||||
protected void doTest(String testFileName) throws Exception {
|
protected void doTest(String testFileName) throws Exception {
|
||||||
doTest(testFileName, true, true);
|
doTest(testFileName, true, true);
|
||||||
}
|
}
|
||||||
+39
-39
@@ -30,9 +30,9 @@ import java.util.regex.Pattern;
|
|||||||
@SuppressWarnings("all")
|
@SuppressWarnings("all")
|
||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({LazyResolveByStubTestGenerated.Annotations.class, LazyResolveByStubTestGenerated.Class.class, LazyResolveByStubTestGenerated.ClassFun.class, LazyResolveByStubTestGenerated.ClassObject.class, LazyResolveByStubTestGenerated.Constructor.class, LazyResolveByStubTestGenerated.DataClass.class, LazyResolveByStubTestGenerated.Enum.class, LazyResolveByStubTestGenerated.FromLoadJava.class, LazyResolveByStubTestGenerated.Fun.class, LazyResolveByStubTestGenerated.Inline.class, LazyResolveByStubTestGenerated.MemberOrder.class, LazyResolveByStubTestGenerated.Nested.class, LazyResolveByStubTestGenerated.PlatformTypes.class, LazyResolveByStubTestGenerated.Prop.class, LazyResolveByStubTestGenerated.Type.class, LazyResolveByStubTestGenerated.Visibility.class})
|
@InnerTestClasses({ResolveByStubTestGenerated.Annotations.class, ResolveByStubTestGenerated.Class.class, ResolveByStubTestGenerated.ClassFun.class, ResolveByStubTestGenerated.ClassObject.class, ResolveByStubTestGenerated.Constructor.class, ResolveByStubTestGenerated.DataClass.class, ResolveByStubTestGenerated.Enum.class, ResolveByStubTestGenerated.FromLoadJava.class, ResolveByStubTestGenerated.Fun.class, ResolveByStubTestGenerated.Inline.class, ResolveByStubTestGenerated.MemberOrder.class, ResolveByStubTestGenerated.Nested.class, ResolveByStubTestGenerated.PlatformTypes.class, ResolveByStubTestGenerated.Prop.class, ResolveByStubTestGenerated.Type.class, ResolveByStubTestGenerated.Visibility.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTest {
|
public class ResolveByStubTestGenerated extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInCompiledKotlin() throws Exception {
|
public void testAllFilesPresentInCompiledKotlin() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({Annotations.ClassMembers.class, Annotations.Classes.class, Annotations.PackageMembers.class, Annotations.Parameters.class, Annotations.PropertiesWithoutBackingFields.class})
|
@InnerTestClasses({Annotations.ClassMembers.class, Annotations.Classes.class, Annotations.PackageMembers.class, Annotations.Parameters.class, Annotations.PropertiesWithoutBackingFields.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Annotations extends AbstractLazyResolveByStubTest {
|
public static class Annotations extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInAnnotations() throws Exception {
|
public void testAllFilesPresentInAnnotations() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -67,7 +67,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/classMembers")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/classMembers")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class ClassMembers extends AbstractLazyResolveByStubTest {
|
public static class ClassMembers extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInClassMembers() throws Exception {
|
public void testAllFilesPresentInClassMembers() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/classMembers"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/classMembers"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/classes")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/classes")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Classes extends AbstractLazyResolveByStubTest {
|
public static class Classes extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInClasses() throws Exception {
|
public void testAllFilesPresentInClasses() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/classes"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/classes"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -211,7 +211,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/packageMembers")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/packageMembers")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class PackageMembers extends AbstractLazyResolveByStubTest {
|
public static class PackageMembers extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInPackageMembers() throws Exception {
|
public void testAllFilesPresentInPackageMembers() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/packageMembers"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/packageMembers"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -268,7 +268,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/parameters")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/parameters")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Parameters extends AbstractLazyResolveByStubTest {
|
public static class Parameters extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInParameters() throws Exception {
|
public void testAllFilesPresentInParameters() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/parameters"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/parameters"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -343,7 +343,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/propertiesWithoutBackingFields")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/annotations/propertiesWithoutBackingFields")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class PropertiesWithoutBackingFields extends AbstractLazyResolveByStubTest {
|
public static class PropertiesWithoutBackingFields extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInPropertiesWithoutBackingFields() throws Exception {
|
public void testAllFilesPresentInPropertiesWithoutBackingFields() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/propertiesWithoutBackingFields"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/annotations/propertiesWithoutBackingFields"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -402,7 +402,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({Class.JavaBean.class})
|
@InnerTestClasses({Class.JavaBean.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Class extends AbstractLazyResolveByStubTest {
|
public static class Class extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInClass() throws Exception {
|
public void testAllFilesPresentInClass() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/class"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/class"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -608,7 +608,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/class/javaBean")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/class/javaBean")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class JavaBean extends AbstractLazyResolveByStubTest {
|
public static class JavaBean extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInJavaBean() throws Exception {
|
public void testAllFilesPresentInJavaBean() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/class/javaBean"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/class/javaBean"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -654,7 +654,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/classFun")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/classFun")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class ClassFun extends AbstractLazyResolveByStubTest {
|
public static class ClassFun extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInClassFun() throws Exception {
|
public void testAllFilesPresentInClassFun() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/classFun"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/classFun"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -699,7 +699,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/classObject")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/classObject")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class ClassObject extends AbstractLazyResolveByStubTest {
|
public static class ClassObject extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInClassObject() throws Exception {
|
public void testAllFilesPresentInClassObject() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/classObject"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/classObject"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -781,7 +781,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({Constructor.Vararg.class})
|
@InnerTestClasses({Constructor.Vararg.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Constructor extends AbstractLazyResolveByStubTest {
|
public static class Constructor extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInConstructor() throws Exception {
|
public void testAllFilesPresentInConstructor() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/constructor"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/constructor"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -885,7 +885,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/constructor/vararg")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/constructor/vararg")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Vararg extends AbstractLazyResolveByStubTest {
|
public static class Vararg extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInVararg() throws Exception {
|
public void testAllFilesPresentInVararg() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/constructor/vararg"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/constructor/vararg"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -907,7 +907,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/dataClass")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/dataClass")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class DataClass extends AbstractLazyResolveByStubTest {
|
public static class DataClass extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInDataClass() throws Exception {
|
public void testAllFilesPresentInDataClass() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/dataClass"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/dataClass"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -964,7 +964,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/enum")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/enum")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Enum extends AbstractLazyResolveByStubTest {
|
public static class Enum extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInEnum() throws Exception {
|
public void testAllFilesPresentInEnum() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/enum"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/enum"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -1010,7 +1010,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({FromLoadJava.KotlinSignature.class, FromLoadJava.Library.class, FromLoadJava.Modality.class, FromLoadJava.NotNull.class})
|
@InnerTestClasses({FromLoadJava.KotlinSignature.class, FromLoadJava.Library.class, FromLoadJava.Modality.class, FromLoadJava.NotNull.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class FromLoadJava extends AbstractLazyResolveByStubTest {
|
public static class FromLoadJava extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInFromLoadJava() throws Exception {
|
public void testAllFilesPresentInFromLoadJava() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -1223,7 +1223,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({KotlinSignature.Error.class, KotlinSignature.Propagation.class})
|
@InnerTestClasses({KotlinSignature.Error.class, KotlinSignature.Propagation.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class KotlinSignature extends AbstractLazyResolveByStubTest {
|
public static class KotlinSignature extends AbstractResolveByStubTest {
|
||||||
@TestMetadata("AllBoundsInWhen.kt")
|
@TestMetadata("AllBoundsInWhen.kt")
|
||||||
public void testAllBoundsInWhen() throws Exception {
|
public void testAllBoundsInWhen() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/AllBoundsInWhen.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/AllBoundsInWhen.kt");
|
||||||
@@ -1327,7 +1327,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/error")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/error")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Error extends AbstractLazyResolveByStubTest {
|
public static class Error extends AbstractResolveByStubTest {
|
||||||
@TestMetadata("AddingNullability.kt")
|
@TestMetadata("AddingNullability.kt")
|
||||||
public void testAddingNullability() throws Exception {
|
public void testAddingNullability() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/error/AddingNullability.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/error/AddingNullability.kt");
|
||||||
@@ -1499,7 +1499,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({Propagation.Parameter.class, Propagation.Return.class, Propagation.TypeParameter.class})
|
@InnerTestClasses({Propagation.Parameter.class, Propagation.Return.class, Propagation.TypeParameter.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Propagation extends AbstractLazyResolveByStubTest {
|
public static class Propagation extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInPropagation() throws Exception {
|
public void testAllFilesPresentInPropagation() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -1513,7 +1513,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/parameter")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/parameter")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Parameter extends AbstractLazyResolveByStubTest {
|
public static class Parameter extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInParameter() throws Exception {
|
public void testAllFilesPresentInParameter() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/parameter"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/parameter"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -1678,7 +1678,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/return")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/return")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Return extends AbstractLazyResolveByStubTest {
|
public static class Return extends AbstractResolveByStubTest {
|
||||||
@TestMetadata("AddNotNullJavaSubtype.kt")
|
@TestMetadata("AddNotNullJavaSubtype.kt")
|
||||||
public void testAddNotNullJavaSubtype() throws Exception {
|
public void testAddNotNullJavaSubtype() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/return/AddNotNullJavaSubtype.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/return/AddNotNullJavaSubtype.kt");
|
||||||
@@ -1891,7 +1891,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/typeParameter")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/typeParameter")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class TypeParameter extends AbstractLazyResolveByStubTest {
|
public static class TypeParameter extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInTypeParameter() throws Exception {
|
public void testAllFilesPresentInTypeParameter() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/typeParameter"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/kotlinSignature/propagation/typeParameter"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -1956,7 +1956,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/library")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/library")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Library extends AbstractLazyResolveByStubTest {
|
public static class Library extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInLibrary() throws Exception {
|
public void testAllFilesPresentInLibrary() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/library"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/library"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -1983,7 +1983,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/modality")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/modality")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Modality extends AbstractLazyResolveByStubTest {
|
public static class Modality extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInModality() throws Exception {
|
public void testAllFilesPresentInModality() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/modality"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/modality"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -1998,7 +1998,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/notNull")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fromLoadJava/notNull")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class NotNull extends AbstractLazyResolveByStubTest {
|
public static class NotNull extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInNotNull() throws Exception {
|
public void testAllFilesPresentInNotNull() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/notNull"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fromLoadJava/notNull"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2039,7 +2039,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({Fun.GenericWithTypeVariables.class, Fun.GenericWithoutTypeVariables.class, Fun.NonGeneric.class, Fun.Vararg.class})
|
@InnerTestClasses({Fun.GenericWithTypeVariables.class, Fun.GenericWithoutTypeVariables.class, Fun.NonGeneric.class, Fun.Vararg.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Fun extends AbstractLazyResolveByStubTest {
|
public static class Fun extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInFun() throws Exception {
|
public void testAllFilesPresentInFun() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2107,7 +2107,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fun/genericWithTypeVariables")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fun/genericWithTypeVariables")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class GenericWithTypeVariables extends AbstractLazyResolveByStubTest {
|
public static class GenericWithTypeVariables extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInGenericWithTypeVariables() throws Exception {
|
public void testAllFilesPresentInGenericWithTypeVariables() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun/genericWithTypeVariables"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun/genericWithTypeVariables"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2176,7 +2176,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fun/genericWithoutTypeVariables")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fun/genericWithoutTypeVariables")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class GenericWithoutTypeVariables extends AbstractLazyResolveByStubTest {
|
public static class GenericWithoutTypeVariables extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInGenericWithoutTypeVariables() throws Exception {
|
public void testAllFilesPresentInGenericWithoutTypeVariables() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun/genericWithoutTypeVariables"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun/genericWithoutTypeVariables"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2215,7 +2215,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fun/nonGeneric")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fun/nonGeneric")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class NonGeneric extends AbstractLazyResolveByStubTest {
|
public static class NonGeneric extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInNonGeneric() throws Exception {
|
public void testAllFilesPresentInNonGeneric() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun/nonGeneric"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun/nonGeneric"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2320,7 +2320,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fun/vararg")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/fun/vararg")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Vararg extends AbstractLazyResolveByStubTest {
|
public static class Vararg extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInVararg() throws Exception {
|
public void testAllFilesPresentInVararg() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun/vararg"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/fun/vararg"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2348,7 +2348,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/inline")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/inline")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Inline extends AbstractLazyResolveByStubTest {
|
public static class Inline extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInInline() throws Exception {
|
public void testAllFilesPresentInInline() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/inline"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/inline"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2363,7 +2363,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/memberOrder")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/memberOrder")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class MemberOrder extends AbstractLazyResolveByStubTest {
|
public static class MemberOrder extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInMemberOrder() throws Exception {
|
public void testAllFilesPresentInMemberOrder() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/memberOrder"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/memberOrder"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2408,7 +2408,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/nested")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/nested")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Nested extends AbstractLazyResolveByStubTest {
|
public static class Nested extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInNested() throws Exception {
|
public void testAllFilesPresentInNested() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/nested"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/nested"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2435,7 +2435,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/platformTypes")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/platformTypes")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class PlatformTypes extends AbstractLazyResolveByStubTest {
|
public static class PlatformTypes extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInPlatformTypes() throws Exception {
|
public void testAllFilesPresentInPlatformTypes() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/platformTypes"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/platformTypes"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2457,7 +2457,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@InnerTestClasses({Prop.DefaultAccessors.class})
|
@InnerTestClasses({Prop.DefaultAccessors.class})
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Prop extends AbstractLazyResolveByStubTest {
|
public static class Prop extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInProp() throws Exception {
|
public void testAllFilesPresentInProp() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/prop"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/prop"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2657,7 +2657,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/prop/defaultAccessors")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/prop/defaultAccessors")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class DefaultAccessors extends AbstractLazyResolveByStubTest {
|
public static class DefaultAccessors extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInDefaultAccessors() throws Exception {
|
public void testAllFilesPresentInDefaultAccessors() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/prop/defaultAccessors"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/prop/defaultAccessors"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2727,7 +2727,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/type")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/type")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Type extends AbstractLazyResolveByStubTest {
|
public static class Type extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInType() throws Exception {
|
public void testAllFilesPresentInType() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/type"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/type"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
@@ -2916,7 +2916,7 @@ public class LazyResolveByStubTestGenerated extends AbstractLazyResolveByStubTes
|
|||||||
@TestMetadata("compiler/testData/loadJava/compiledKotlin/visibility")
|
@TestMetadata("compiler/testData/loadJava/compiledKotlin/visibility")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public static class Visibility extends AbstractLazyResolveByStubTest {
|
public static class Visibility extends AbstractResolveByStubTest {
|
||||||
public void testAllFilesPresentInVisibility() throws Exception {
|
public void testAllFilesPresentInVisibility() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/visibility"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledKotlin/visibility"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
+6
-3
@@ -16,20 +16,23 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.resolve;
|
package org.jetbrains.jet.resolve;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
||||||
import org.jetbrains.jet.lang.psi.JetClassInitializer;
|
import org.jetbrains.jet.lang.psi.JetClassInitializer;
|
||||||
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
import org.jetbrains.jet.lang.psi.JetDeclaration;
|
||||||
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
import org.jetbrains.jet.lang.psi.JetPsiUtil;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRendererTest;
|
|
||||||
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
|
import org.jetbrains.jet.lang.resolve.lazy.ResolveSession;
|
||||||
import org.jetbrains.jet.plugin.project.ResolveElementCache;
|
import org.jetbrains.jet.plugin.project.ResolveElementCache;
|
||||||
|
import org.jetbrains.jet.renderer.AbstractDescriptorRendererTest;
|
||||||
|
|
||||||
public abstract class AbstractAdditionalLazyResolveDescriptorRendererTest extends AbstractLazyResolveDescriptorRendererTest {
|
public abstract class AbstractAdditionalResolveDescriptorRendererTest extends AbstractDescriptorRendererTest {
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
protected DeclarationDescriptor getDescriptor(JetDeclaration declaration, ResolveSession resolveSession) {
|
protected DeclarationDescriptor getDescriptor(@NotNull JetDeclaration declaration, @NotNull ResolveSession resolveSession) {
|
||||||
if (declaration instanceof JetClassInitializer || JetPsiUtil.isLocal(declaration)) {
|
if (declaration instanceof JetClassInitializer || JetPsiUtil.isLocal(declaration)) {
|
||||||
ResolveElementCache resolveElementCache = new ResolveElementCache(resolveSession, getProject());
|
ResolveElementCache resolveElementCache = new ResolveElementCache(resolveSession, getProject());
|
||||||
|
//noinspection ConstantConditions
|
||||||
return resolveElementCache.resolveToElement(declaration).get(BindingContext.DECLARATION_TO_DESCRIPTOR, declaration);
|
return resolveElementCache.resolveToElement(declaration).get(BindingContext.DECLARATION_TO_DESCRIPTOR, declaration);
|
||||||
}
|
}
|
||||||
return resolveSession.resolveToDescriptor(declaration);
|
return resolveSession.resolveToDescriptor(declaration);
|
||||||
+1
-1
@@ -31,7 +31,7 @@ import java.util.regex.Pattern;
|
|||||||
@TestMetadata("idea/testData/resolve/additionalLazyResolve")
|
@TestMetadata("idea/testData/resolve/additionalLazyResolve")
|
||||||
@TestDataPath("$PROJECT_ROOT")
|
@TestDataPath("$PROJECT_ROOT")
|
||||||
@RunWith(JUnit3RunnerWithInners.class)
|
@RunWith(JUnit3RunnerWithInners.class)
|
||||||
public class AdditionalLazyResolveDescriptorRendererTestGenerated extends AbstractAdditionalLazyResolveDescriptorRendererTest {
|
public class AdditionalResolveDescriptorRendererTestGenerated extends AbstractAdditionalResolveDescriptorRendererTest {
|
||||||
public void testAllFilesPresentInAdditionalLazyResolve() throws Exception {
|
public void testAllFilesPresentInAdditionalLazyResolve() throws Exception {
|
||||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/additionalLazyResolve"), Pattern.compile("^(.+)\\.kt$"), true);
|
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/resolve/additionalLazyResolve"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user