Search in sources :

Example 6 with PackageViewDescriptor

use of org.jetbrains.kotlin.descriptors.PackageViewDescriptor in project kotlin by JetBrains.

the class AbstractResolveByStubTest method performTest.

private void performTest(@NotNull String path, boolean checkPrimaryConstructors, boolean checkPropertyAccessors) {
    KtFile file = (KtFile) getFile();
    ModuleDescriptor module = ResolutionUtils.findModuleDescriptor(file);
    PackageViewDescriptor packageViewDescriptor = module.getPackage(new FqName("test"));
    Assert.assertFalse(packageViewDescriptor.isEmpty());
    File fileToCompareTo = new File(FileUtil.getNameWithoutExtension(path) + ".txt");
    RecursiveDescriptorComparator.validateAndCompareDescriptorWithFile(packageViewDescriptor, RecursiveDescriptorComparator.DONT_INCLUDE_METHODS_OF_OBJECT.filterRecursion(RecursiveDescriptorComparator.SKIP_BUILT_INS_PACKAGES).checkPrimaryConstructors(checkPrimaryConstructors).checkPropertyAccessors(checkPropertyAccessors).withValidationStrategy(errorTypesForbidden()), fileToCompareTo);
}
Also used : ModuleDescriptor(org.jetbrains.kotlin.descriptors.ModuleDescriptor) FqName(org.jetbrains.kotlin.name.FqName) KtFile(org.jetbrains.kotlin.psi.KtFile) KtFile(org.jetbrains.kotlin.psi.KtFile) File(java.io.File) PackageViewDescriptor(org.jetbrains.kotlin.descriptors.PackageViewDescriptor)

Aggregations

PackageViewDescriptor (org.jetbrains.kotlin.descriptors.PackageViewDescriptor)6 File (java.io.File)3 NotNull (org.jetbrains.annotations.NotNull)3 AnalysisResult (org.jetbrains.kotlin.analyzer.AnalysisResult)3 KotlinCoreEnvironment (org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment)3 ArrayList (java.util.ArrayList)2 KtFile (org.jetbrains.kotlin.psi.KtFile)2 CompilerConfiguration (org.jetbrains.kotlin.config.CompilerConfiguration)1 ClassDescriptor (org.jetbrains.kotlin.descriptors.ClassDescriptor)1 ModuleDescriptor (org.jetbrains.kotlin.descriptors.ModuleDescriptor)1 FqName (org.jetbrains.kotlin.name.FqName)1 RecursiveDescriptorComparator (org.jetbrains.kotlin.test.util.RecursiveDescriptorComparator)1 RecursiveDescriptorComparator.validateAndCompareDescriptorWithFile (org.jetbrains.kotlin.test.util.RecursiveDescriptorComparator.validateAndCompareDescriptorWithFile)1