From 99d1a9b7d7f4a7b53692bfbb09748b3b05699994 Mon Sep 17 00:00:00 2001 From: Andrey Breslav Date: Thu, 16 May 2013 19:57:09 +0400 Subject: [PATCH] Serialization tests reuse test data from loadKotlin --- .../AbstractDescriptorSerializationTest.java | 298 +++++ .../DescriptorSerializationTest.java | 263 ---- .../DescriptorSerializationTestGenerated.java | 1143 +++++++++++++++++ .../jet/generators/tests/GenerateTests.java | 8 + 4 files changed, 1449 insertions(+), 263 deletions(-) create mode 100644 compiler/tests/org/jetbrains/jet/descriptors/serialization/AbstractDescriptorSerializationTest.java delete mode 100644 compiler/tests/org/jetbrains/jet/descriptors/serialization/DescriptorSerializationTest.java create mode 100644 compiler/tests/org/jetbrains/jet/descriptors/serialization/DescriptorSerializationTestGenerated.java diff --git a/compiler/tests/org/jetbrains/jet/descriptors/serialization/AbstractDescriptorSerializationTest.java b/compiler/tests/org/jetbrains/jet/descriptors/serialization/AbstractDescriptorSerializationTest.java new file mode 100644 index 00000000000..46951b34a3c --- /dev/null +++ b/compiler/tests/org/jetbrains/jet/descriptors/serialization/AbstractDescriptorSerializationTest.java @@ -0,0 +1,298 @@ +/* + * 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.descriptors.serialization; + +import com.google.common.collect.Lists; +import com.google.protobuf.MessageLite; +import com.intellij.openapi.util.io.FileUtil; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jet.ConfigurationKind; +import org.jetbrains.jet.JetTestUtils; +import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment; +import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedClassDescriptor; +import org.jetbrains.jet.di.InjectorForJavaDescriptorResolver; +import org.jetbrains.jet.lang.descriptors.*; +import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; +import org.jetbrains.jet.lang.descriptors.impl.NamespaceDescriptorImpl; +import org.jetbrains.jet.lang.psi.JetPsiUtil; +import org.jetbrains.jet.lang.resolve.BindingTraceContext; +import org.jetbrains.jet.lang.resolve.DescriptorUtils; +import org.jetbrains.jet.lang.resolve.java.JavaBridgeConfiguration; +import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver; +import org.jetbrains.jet.lang.resolve.java.JavaToKotlinClassMap; +import org.jetbrains.jet.lang.resolve.lazy.KotlinTestWithEnvironment; +import org.jetbrains.jet.lang.resolve.lazy.LazyResolveTestUtil; +import org.jetbrains.jet.lang.resolve.lazy.storage.MemoizedFunctionToNullable; +import org.jetbrains.jet.lang.resolve.lazy.storage.MemoizedFunctionToNullableImpl; +import org.jetbrains.jet.lang.resolve.name.FqName; +import org.jetbrains.jet.lang.resolve.name.Name; +import org.jetbrains.jet.lang.resolve.scopes.JetScope; +import org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler; +import org.jetbrains.jet.lang.resolve.scopes.WritableScope; +import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl; +import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; +import org.jetbrains.jet.test.util.NamespaceComparator; + +import java.io.*; +import java.util.*; + +public abstract class AbstractDescriptorSerializationTest extends KotlinTestWithEnvironment { + + @Override + protected JetCoreEnvironment createEnvironment() { + return createEnvironmentWithMockJdk(ConfigurationKind.JDK_ONLY); + } + + protected void doTest(String path) throws IOException { + File ktFile = new File(path); + ModuleDescriptor moduleDescriptor = LazyResolveTestUtil.resolveEagerly(Collections.singletonList( + JetTestUtils.createFile(ktFile.getName(), FileUtil.loadFile(ktFile), getProject()) + ), getEnvironment()); + + NamespaceDescriptor testNamespace = moduleDescriptor.getNamespace(FqName.topLevel(Name.identifier("test"))); + assert testNamespace != null; + + JavaDescriptorResolver javaDescriptorResolver = new InjectorForJavaDescriptorResolver( + getProject(), new BindingTraceContext(), moduleDescriptor).getJavaDescriptorResolver(); + + Collection initial = testNamespace.getMemberScope().getAllDescriptors(); + + NamespaceDescriptor deserialized = serializeAndDeserialize(javaDescriptorResolver, initial); + + NamespaceComparator.validateAndCompareNamespaces(testNamespace, deserialized, NamespaceComparator.RECURSIVE, null); + } + + private static NamespaceDescriptor serializeAndDeserialize( + JavaDescriptorResolver javaDescriptorResolver, + Collection initial + ) throws IOException { + List classes = Lists.newArrayList(); + List callables = Lists.newArrayList(); + for (DeclarationDescriptor descriptor : initial) { + if (descriptor instanceof ClassDescriptor) { + ClassDescriptor classDescriptor = (ClassDescriptor) descriptor; + classes.add(classDescriptor); + } + else if (descriptor instanceof CallableMemberDescriptor) { + CallableMemberDescriptor memberDescriptor = (CallableMemberDescriptor) descriptor; + callables.add(memberDescriptor); + } + else { + fail("Unsupported descriptor type: " + descriptor); + } + } + return getDeserializedDescriptors(javaDescriptorResolver, classes, callables); + } + + private static NamespaceDescriptor getDeserializedDescriptors( + final JavaDescriptorResolver javaDescriptorResolver, + List classes, + List callables + ) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + serialize(classes, callables, out); + + InputStream in = new ByteArrayInputStream(out.toByteArray()); + + ProtoBuf.SimpleNameTable simpleNames = ProtoBuf.SimpleNameTable.parseDelimitedFrom(in); + ProtoBuf.QualifiedNameTable qualifiedNames = ProtoBuf.QualifiedNameTable.parseDelimitedFrom(in); + + List classProtos = Lists.newArrayList(); + List callableProtos = Lists.newArrayList(); + + for (int i = 0; i < classes.size(); i++) { + ProtoBuf.Class proto = ProtoBuf.Class.parseDelimitedFrom(in); + classProtos.add(proto); + } + + for (int i = 0; i < callables.size(); i++) { + ProtoBuf.Callable proto = ProtoBuf.Callable.parseDelimitedFrom(in); + callableProtos.add(proto); + } + + NamespaceDescriptorImpl namespace = createTestNamespace(); + ClassResolver javaClassResolver = new JavaClassResolver(javaDescriptorResolver); + + ClassResolverImpl classResolver = new ClassResolverImpl( + javaClassResolver, namespace, simpleNames, qualifiedNames, classProtos + ); + + for (ProtoBuf.Class proto : classProtos) { + FqName fqName = new FqName("test." + classResolver.getNameResolver().getName(proto.getName())); + ClassDescriptor descriptor = classResolver.findClass(fqName); + assert descriptor != null : "Class not loaded: " + fqName; + namespace.getMemberScope().addClassifierDescriptor(descriptor); + } + + DescriptorDeserializer deserializer = + new DescriptorDeserializer((DescriptorDeserializer) null, namespace, new NameResolver(simpleNames, qualifiedNames, classResolver)); + for (ProtoBuf.Callable proto : callableProtos) { + CallableMemberDescriptor descriptor = deserializer.loadCallable(proto); + if (descriptor instanceof FunctionDescriptor) { + namespace.getMemberScope().addFunctionDescriptor((FunctionDescriptor) descriptor); + } + else if (descriptor instanceof PropertyDescriptor) { + namespace.getMemberScope().addPropertyDescriptor((PropertyDescriptor) descriptor); + } + else { + throw new IllegalStateException("Unknown descriptor type: " + descriptor); + } + } + namespace.getMemberScope().changeLockLevel(WritableScope.LockLevel.READING); + + return namespace; + } + + private static NamespaceDescriptorImpl createTestNamespace() { + ModuleDescriptorImpl module = new ModuleDescriptorImpl(Name.special(""), JavaBridgeConfiguration.ALL_JAVA_IMPORTS, + JavaToKotlinClassMap.getInstance()); + NamespaceDescriptorImpl rootNamespace = + new NamespaceDescriptorImpl(module, Collections.emptyList(), JetPsiUtil.ROOT_NAMESPACE_NAME); + module.setRootNamespace(rootNamespace); + NamespaceDescriptorImpl test = + new NamespaceDescriptorImpl(rootNamespace, Collections.emptyList(), Name.identifier("test")); + test.initialize(new WritableScopeImpl(JetScope.EMPTY, test, RedeclarationHandler.DO_NOTHING, "members of test namespace")); + return test; + } + + public static void serialize( + List classes, List callables, @NotNull OutputStream out + ) throws IOException { + DescriptorSerializer descriptorSerializer = new DescriptorSerializer(); + + List messages = Lists.newArrayList(); + for (ClassDescriptor classDescriptor : classes) { + messages.add(descriptorSerializer.classProto(classDescriptor).build()); + + } + + for (CallableMemberDescriptor callable : callables) { + messages.add(descriptorSerializer.callableProto(callable).build()); + } + + NameSerializationUtil.serializeNameTable(out, descriptorSerializer.getNameTable()); + + for (MessageLite message : messages) { + message.writeDelimitedTo(out); + } + } + + private static class ClassResolverImpl implements ClassResolver { + private final ClassResolver parentResolver; + + private final DeclarationDescriptor parentForClasses; + private final FqName parentFqName; + private final NameResolver nameResolver; + private final Map classProtos; + + private final MemoizedFunctionToNullable classes; + + public ClassResolverImpl( + @NotNull ClassResolver parentResolver, + @NotNull DeclarationDescriptor parentForClasses, + @NotNull ProtoBuf.SimpleNameTable simpleNames, + @NotNull ProtoBuf.QualifiedNameTable qualifiedNames, + @NotNull List classProtos + ) { + this.parentResolver = parentResolver; + + this.parentForClasses = parentForClasses; + this.parentFqName = DescriptorUtils.getFQName(parentForClasses).toSafe(); + + this.nameResolver = new NameResolver(simpleNames, qualifiedNames, this); + this.classProtos = toMap(classProtos); + + this.classes = new MemoizedFunctionToNullableImpl() { + @Nullable + @Override + protected ClassDescriptor doCompute(@NotNull FqName fqName) { + return resolveClass(fqName); + } + }; + } + + @NotNull + private Map toMap(@NotNull List classProtos) { + Map map = new HashMap(classProtos.size()); + for (ProtoBuf.Class classProto : classProtos) { + map.put(nameResolver.getName(classProto.getName()), classProto); + } + return map; + } + + @NotNull + public NameResolver getNameResolver() { + return nameResolver; + } + + @Nullable + private ClassDescriptor resolveClass(@NotNull FqName fqName) { + if (!parentFqName.equals(fqName.parent())) { + return parentResolver.findClass(fqName); + } + + ProtoBuf.Class classProto = classProtos.get(fqName.shortName()); + if (classProto == null) { + return parentResolver.findClass(fqName); + } + + return new DeserializedClassDescriptor(parentForClasses, nameResolver, this, classProto, null); + } + + @Nullable + @Override + public ClassDescriptor findClass(@NotNull FqName fqName) { + return classes.fun(fqName); + } + } + + private static class JavaClassResolver implements ClassResolver { + private final JavaDescriptorResolver javaDescriptorResolver; + + public JavaClassResolver(JavaDescriptorResolver javaDescriptorResolver) { + this.javaDescriptorResolver = javaDescriptorResolver; + } + + @Nullable + @Override + public ClassDescriptor findClass(@NotNull FqName fqName) { + ClassDescriptor classDescriptor = javaDescriptorResolver.resolveClass(fqName); + if (classDescriptor != null) { + return classDescriptor; + } + FqName current = fqName; + while (!current.isRoot()) { + NamespaceDescriptor namespace = getNamespace(current); + if (namespace != null) { + ClassDescriptor classifier = (ClassDescriptor) namespace.getMemberScope().getClassifier(current.shortName()); + if (classifier == null) { + throw new IllegalStateException("Class not found: " + fqName); + } + return classifier; + } + current = current.parent(); + } + throw new IllegalStateException("Class not found: " + fqName); + } + + @Nullable + private NamespaceDescriptor getNamespace(@NotNull FqName fqName) { + return javaDescriptorResolver.resolveNamespace(fqName); + } + } +} diff --git a/compiler/tests/org/jetbrains/jet/descriptors/serialization/DescriptorSerializationTest.java b/compiler/tests/org/jetbrains/jet/descriptors/serialization/DescriptorSerializationTest.java deleted file mode 100644 index 4b7f856f96b..00000000000 --- a/compiler/tests/org/jetbrains/jet/descriptors/serialization/DescriptorSerializationTest.java +++ /dev/null @@ -1,263 +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.descriptors.serialization; - -import com.google.common.collect.Lists; -import com.google.protobuf.MessageLite; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.ConfigurationKind; -import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment; -import org.jetbrains.jet.descriptors.serialization.descriptors.DeserializedClassDescriptor; -import org.jetbrains.jet.lang.descriptors.ClassDescriptor; -import org.jetbrains.jet.lang.descriptors.ClassifierDescriptor; -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; -import org.jetbrains.jet.lang.descriptors.NamespaceDescriptor; -import org.jetbrains.jet.lang.resolve.DescriptorUtils; -import org.jetbrains.jet.lang.resolve.lazy.KotlinTestWithEnvironment; -import org.jetbrains.jet.lang.resolve.lazy.storage.MemoizedFunctionToNullable; -import org.jetbrains.jet.lang.resolve.lazy.storage.MemoizedFunctionToNullableImpl; -import org.jetbrains.jet.lang.resolve.name.FqName; -import org.jetbrains.jet.lang.resolve.name.Name; -import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns; -import org.jetbrains.jet.renderer.DescriptorRenderer; -import org.jetbrains.jet.renderer.DescriptorRendererBuilder; -import org.jetbrains.jet.utils.Printer; -import org.jetbrains.jet.utils.Profiler; - -import java.io.*; -import java.util.*; - -public class DescriptorSerializationTest extends KotlinTestWithEnvironment { - - private static final DescriptorRenderer RENDERER = new DescriptorRendererBuilder() - .setVerbose(true) - .build(); - - @Override - protected JetCoreEnvironment createEnvironment() { - return createEnvironmentWithMockJdk(ConfigurationKind.JDK_ONLY); - } - - public void testBuiltins() throws Exception { - doTest(KotlinBuiltIns.getInstance().getBuiltInsScope().getAllDescriptors()); - } - - public void testBooleanIterator() throws Exception { - ClassifierDescriptor classifier = KotlinBuiltIns.getInstance().getBuiltInsScope().getClassifier(Name.identifier("BooleanIterator")); - doTest(Collections.singletonList(classifier)); - } - - private static void doTest(Collection initial) throws IOException { - List resulting = getDeserializedDescriptors(initial); - - String actualText = toText(resulting); - String expectedText = toText(initial); - - assertEquals(expectedText, actualText); - } - - private static List getDeserializedDescriptors(Collection descriptors) throws IOException { - Profiler serialize = Profiler.create("serialize").start(); - - ByteArrayOutputStream out = new ByteArrayOutputStream(); - serialize(descriptors, out); - - serialize.end(); - - System.out.println("Size in bytes: " + out.size()); - - Profiler deserialize = Profiler.create("deserialize").start(); - - InputStream in = new ByteArrayInputStream(out.toByteArray()); - - ProtoBuf.SimpleNameTable simpleNames = ProtoBuf.SimpleNameTable.parseDelimitedFrom(in); - ProtoBuf.QualifiedNameTable qualifiedNames = ProtoBuf.QualifiedNameTable.parseDelimitedFrom(in); - List classProtos = parseClasses(in); - - ClassResolverImpl classResolver = new ClassResolverImpl( - new ClassResolver() { - @Nullable - @Override - public ClassDescriptor findClass(@NotNull FqName fqName) { - while (!fqName.isRoot()) { - NamespaceDescriptor namespace = KotlinBuiltIns.getInstance().getBuiltInsModule().getNamespace(fqName.parent()); - if (namespace == null) { - fqName = fqName.parent(); - } - else { - return (ClassDescriptor) namespace.getMemberScope().getClassifier(fqName.shortName()); - } - } - return null; - } - }, KotlinBuiltIns.getInstance().getBuiltInsPackage(), simpleNames, qualifiedNames, classProtos - ); - - List result = new ArrayList(); - for (ProtoBuf.Class classProto : classProtos) { - ClassDescriptor classDescriptor = - classResolver.findClass(new FqName("jet." + classResolver.getNameResolver().getName(classProto.getName()))); - result.add(classDescriptor); - } - - deserialize.end(); - - return result; - } - - public static void serialize( - @NotNull Collection descriptors, - @NotNull OutputStream out - ) throws IOException { - DescriptorSerializer descriptorSerializer = new DescriptorSerializer(); - - List messages = new ArrayList(); - for (DeclarationDescriptor descriptor : descriptors) { - if (descriptor instanceof ClassDescriptor) { - ClassDescriptor classDescriptor = (ClassDescriptor) descriptor; - messages.add(descriptorSerializer.classProto(classDescriptor).build()); - - } - } - - NameSerializationUtil.serializeNameTable(out, descriptorSerializer.getNameTable()); - - for (MessageLite message : messages) { - message.writeDelimitedTo(out); - } - } - - private static List parseClasses(InputStream in) throws IOException { - List classProtos = new ArrayList(); - while (true) { - ProtoBuf.Class classProto = ProtoBuf.Class.parseDelimitedFrom(in); - if (classProto == null) break; - classProtos.add(classProto); - } - return classProtos; - } - - - private static String toText(Collection resulting) { - StringBuilder resultingBuilder = new StringBuilder(); - printSorted(resulting, new Printer(resultingBuilder)); - - return resultingBuilder.toString(); - } - - private static void printSorted(Collection descriptors, Printer p) { - Comparator comparator = new Comparator() { - @Override - public int compare( - DeclarationDescriptor o1, DeclarationDescriptor o2 - ) { - int names = o1.getName().getName().compareTo(o2.getName().getName()); - if (names != 0) return names; - return RENDERER.render(o1).compareTo(RENDERER.render(o2)); - } - }; - - List sortedDescriptors = Lists.newArrayList(descriptors); - Collections.sort(sortedDescriptors, comparator); - - for (DeclarationDescriptor descriptor : sortedDescriptors) { - p.println(RENDERER.render(descriptor)); - - if (descriptor instanceof ClassDescriptor) { - ClassDescriptor classDescriptor = (ClassDescriptor) descriptor; - p.pushIndent(); - List members = Lists.newArrayList( - classDescriptor.getDefaultType().getMemberScope().getAllDescriptors()); - Collections.sort(members, comparator); - for (DeclarationDescriptor member : members) { - p.println(RENDERER.render(member)); - } - p.popIndent(); - } - } - } - - private static class ClassResolverImpl implements ClassResolver { - private final ClassResolver parentResolver; - - private final DeclarationDescriptor parentForClasses; - private final FqName parentFqName; - private final NameResolver nameResolver; - private final Map classProtos; - - private final MemoizedFunctionToNullable classes; - - public ClassResolverImpl( - @NotNull ClassResolver parentResolver, - @NotNull DeclarationDescriptor parentForClasses, - @NotNull ProtoBuf.SimpleNameTable simpleNames, - @NotNull ProtoBuf.QualifiedNameTable qualifiedNames, - @NotNull List classProtos - ) { - this.parentResolver = parentResolver; - - this.parentForClasses = parentForClasses; - this.parentFqName = DescriptorUtils.getFQName(parentForClasses).toSafe(); - - this.nameResolver = new NameResolver(simpleNames, qualifiedNames, this); - this.classProtos = toMap(classProtos); - - this.classes = new MemoizedFunctionToNullableImpl() { - @Nullable - @Override - protected ClassDescriptor doCompute(@NotNull FqName fqName) { - return resolveClass(fqName); - } - }; - } - - @NotNull - private Map toMap(@NotNull List classProtos) { - Map map = new HashMap(classProtos.size()); - for (ProtoBuf.Class classProto : classProtos) { - map.put(nameResolver.getName(classProto.getName()), classProto); - } - return map; - } - - @NotNull - public NameResolver getNameResolver() { - return nameResolver; - } - - @Nullable - private ClassDescriptor resolveClass(@NotNull FqName fqName) { - if (!parentFqName.equals(fqName.parent())) { - return parentResolver.findClass(fqName); - } - - ProtoBuf.Class classProto = classProtos.get(fqName.shortName()); - if (classProto == null) { - return parentResolver.findClass(fqName); - } - - return new DeserializedClassDescriptor(parentForClasses, nameResolver, this, classProto, null); - } - - @Nullable - @Override - public ClassDescriptor findClass(@NotNull FqName fqName) { - return classes.fun(fqName); - } - } -} diff --git a/compiler/tests/org/jetbrains/jet/descriptors/serialization/DescriptorSerializationTestGenerated.java b/compiler/tests/org/jetbrains/jet/descriptors/serialization/DescriptorSerializationTestGenerated.java new file mode 100644 index 00000000000..3523accb49d --- /dev/null +++ b/compiler/tests/org/jetbrains/jet/descriptors/serialization/DescriptorSerializationTestGenerated.java @@ -0,0 +1,1143 @@ +/* + * 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.descriptors.serialization; + +import junit.framework.Assert; +import junit.framework.Test; +import junit.framework.TestSuite; + +import java.io.File; +import java.util.regex.Pattern; +import org.jetbrains.jet.JetTestUtils; +import org.jetbrains.jet.test.InnerTestClasses; +import org.jetbrains.jet.test.TestMetadata; + +import org.jetbrains.jet.descriptors.serialization.AbstractDescriptorSerializationTest; + +/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/loadKotlin") +@InnerTestClasses({DescriptorSerializationTestGenerated.Class.class, DescriptorSerializationTestGenerated.ClassFun.class, DescriptorSerializationTestGenerated.ClassObject.class, DescriptorSerializationTestGenerated.Constructor.class, DescriptorSerializationTestGenerated.DataClass.class, DescriptorSerializationTestGenerated.Fun.class, DescriptorSerializationTestGenerated.Prop.class, DescriptorSerializationTestGenerated.Type.class, DescriptorSerializationTestGenerated.Visibility.class}) +public class DescriptorSerializationTestGenerated extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInLoadKotlin() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("compiler/testData/loadKotlin/class") + public static class Class extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInClass() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/class"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("Class.kt") + public void testClass() throws Exception { + doTest("compiler/testData/loadKotlin/class/Class.kt"); + } + + @TestMetadata("ClassInParam.kt") + public void testClassInParam() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassInParam.kt"); + } + + @TestMetadata("ClassInnerClass.kt") + public void testClassInnerClass() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassInnerClass.kt"); + } + + @TestMetadata("ClassMemberConflict.kt") + public void testClassMemberConflict() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassMemberConflict.kt"); + } + + @TestMetadata("ClassOutParam.kt") + public void testClassOutParam() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassOutParam.kt"); + } + + @TestMetadata("ClassParam.kt") + public void testClassParam() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassParam.kt"); + } + + @TestMetadata("ClassParamReferencesParam.kt") + public void testClassParamReferencesParam() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassParamReferencesParam.kt"); + } + + @TestMetadata("ClassParamReferencesParam2.kt") + public void testClassParamReferencesParam2() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassParamReferencesParam2.kt"); + } + + @TestMetadata("ClassParamReferencesSelf.kt") + public void testClassParamReferencesSelf() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassParamReferencesSelf.kt"); + } + + @TestMetadata("ClassParamUpperClassBound.kt") + public void testClassParamUpperClassBound() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassParamUpperClassBound.kt"); + } + + @TestMetadata("ClassParamUpperClassInterfaceBound.kt") + public void testClassParamUpperClassInterfaceBound() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassParamUpperClassInterfaceBound.kt"); + } + + @TestMetadata("ClassParamUpperInterfaceBound.kt") + public void testClassParamUpperInterfaceBound() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassParamUpperInterfaceBound.kt"); + } + + @TestMetadata("ClassTwoParams.kt") + public void testClassTwoParams() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassTwoParams.kt"); + } + + @TestMetadata("ClassTwoParams2.kt") + public void testClassTwoParams2() throws Exception { + doTest("compiler/testData/loadKotlin/class/ClassTwoParams2.kt"); + } + + @TestMetadata("EnumWithGenericConstructorParameter.kt") + public void testEnumWithGenericConstructorParameter() throws Exception { + doTest("compiler/testData/loadKotlin/class/EnumWithGenericConstructorParameter.kt"); + } + + @TestMetadata("EnumWithPrimitiveConstructorParameter.kt") + public void testEnumWithPrimitiveConstructorParameter() throws Exception { + doTest("compiler/testData/loadKotlin/class/EnumWithPrimitiveConstructorParameter.kt"); + } + + @TestMetadata("InheritClassSimple.kt") + public void testInheritClassSimple() throws Exception { + doTest("compiler/testData/loadKotlin/class/InheritClassSimple.kt"); + } + + @TestMetadata("InheritClassWithParam.kt") + public void testInheritClassWithParam() throws Exception { + doTest("compiler/testData/loadKotlin/class/InheritClassWithParam.kt"); + } + + @TestMetadata("InheritSubstitutedMethod.kt") + public void testInheritSubstitutedMethod() throws Exception { + doTest("compiler/testData/loadKotlin/class/InheritSubstitutedMethod.kt"); + } + + @TestMetadata("InheritTraitWithFunctionParam.kt") + public void testInheritTraitWithFunctionParam() throws Exception { + doTest("compiler/testData/loadKotlin/class/InheritTraitWithFunctionParam.kt"); + } + + @TestMetadata("InheritTraitWithParam.kt") + public void testInheritTraitWithParam() throws Exception { + doTest("compiler/testData/loadKotlin/class/InheritTraitWithParam.kt"); + } + + @TestMetadata("InnerClassExtendInnerClass.kt") + public void testInnerClassExtendInnerClass() throws Exception { + doTest("compiler/testData/loadKotlin/class/InnerClassExtendInnerClass.kt"); + } + + @TestMetadata("InnerGenericClass.kt") + public void testInnerGenericClass() throws Exception { + doTest("compiler/testData/loadKotlin/class/InnerGenericClass.kt"); + } + + @TestMetadata("NamedObject.kt") + public void testNamedObject() throws Exception { + doTest("compiler/testData/loadKotlin/class/NamedObject.kt"); + } + + @TestMetadata("NamedObjectInClass.kt") + public void testNamedObjectInClass() throws Exception { + doTest("compiler/testData/loadKotlin/class/NamedObjectInClass.kt"); + } + + @TestMetadata("NamedObjectInClassObject.kt") + public void testNamedObjectInClassObject() throws Exception { + doTest("compiler/testData/loadKotlin/class/NamedObjectInClassObject.kt"); + } + + @TestMetadata("NamedObjectInNamedObject.kt") + public void testNamedObjectInNamedObject() throws Exception { + doTest("compiler/testData/loadKotlin/class/NamedObjectInNamedObject.kt"); + } + + @TestMetadata("NamedObjectWithAnotherTopLevelProperty.kt") + public void testNamedObjectWithAnotherTopLevelProperty() throws Exception { + doTest("compiler/testData/loadKotlin/class/NamedObjectWithAnotherTopLevelProperty.kt"); + } + + @TestMetadata("NestedClass.kt") + public void testNestedClass() throws Exception { + doTest("compiler/testData/loadKotlin/class/NestedClass.kt"); + } + + @TestMetadata("NestedClassExtendNestedClass.kt") + public void testNestedClassExtendNestedClass() throws Exception { + doTest("compiler/testData/loadKotlin/class/NestedClassExtendNestedClass.kt"); + } + + @TestMetadata("NestedGenericClass.kt") + public void testNestedGenericClass() throws Exception { + doTest("compiler/testData/loadKotlin/class/NestedGenericClass.kt"); + } + + @TestMetadata("SingleAbstractMethod.kt") + public void testSingleAbstractMethod() throws Exception { + doTest("compiler/testData/loadKotlin/class/SingleAbstractMethod.kt"); + } + + @TestMetadata("Trait.kt") + public void testTrait() throws Exception { + doTest("compiler/testData/loadKotlin/class/Trait.kt"); + } + + } + + @TestMetadata("compiler/testData/loadKotlin/classFun") + public static class ClassFun extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInClassFun() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/classFun"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ClassInParamUsedInFun.kt") + public void testClassInParamUsedInFun() throws Exception { + doTest("compiler/testData/loadKotlin/classFun/ClassInParamUsedInFun.kt"); + } + + @TestMetadata("ClassParamUsedInFun.kt") + public void testClassParamUsedInFun() throws Exception { + doTest("compiler/testData/loadKotlin/classFun/ClassParamUsedInFun.kt"); + } + + @TestMetadata("FunDelegationToTraitImpl.kt") + public void testFunDelegationToTraitImpl() throws Exception { + doTest("compiler/testData/loadKotlin/classFun/FunDelegationToTraitImpl.kt"); + } + + @TestMetadata("FunInParamSuper.kt") + public void testFunInParamSuper() throws Exception { + doTest("compiler/testData/loadKotlin/classFun/FunInParamSuper.kt"); + } + + @TestMetadata("TraitFinalFun.kt") + public void testTraitFinalFun() throws Exception { + doTest("compiler/testData/loadKotlin/classFun/TraitFinalFun.kt"); + } + + @TestMetadata("TraitOpenFun.kt") + public void testTraitOpenFun() throws Exception { + doTest("compiler/testData/loadKotlin/classFun/TraitOpenFun.kt"); + } + + } + + @TestMetadata("compiler/testData/loadKotlin/classObject") + public static class ClassObject extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInClassObject() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/classObject"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ClassObjectDeclaresVal.kt") + public void testClassObjectDeclaresVal() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVal.kt"); + } + + @TestMetadata("ClassObjectDeclaresVar.kt") + public void testClassObjectDeclaresVar() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/ClassObjectDeclaresVar.kt"); + } + + @TestMetadata("ClassObjectExtendsTrait.kt") + public void testClassObjectExtendsTrait() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTrait.kt"); + } + + @TestMetadata("ClassObjectExtendsTraitWithTP.kt") + public void testClassObjectExtendsTraitWithTP() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/ClassObjectExtendsTraitWithTP.kt"); + } + + @TestMetadata("classObjectInClassStaticFields.kt") + public void testClassObjectInClassStaticFields() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/classObjectInClassStaticFields.kt"); + } + + @TestMetadata("classObjectInTraitStaticFields.kt") + public void testClassObjectInTraitStaticFields() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/classObjectInTraitStaticFields.kt"); + } + + @TestMetadata("ClassObjectPropertyInClass.kt") + public void testClassObjectPropertyInClass() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/ClassObjectPropertyInClass.kt"); + } + + @TestMetadata("InnerClassInClassObject.kt") + public void testInnerClassInClassObject() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/InnerClassInClassObject.kt"); + } + + @TestMetadata("SimpleClassObject.kt") + public void testSimpleClassObject() throws Exception { + doTest("compiler/testData/loadKotlin/classObject/SimpleClassObject.kt"); + } + + } + + @TestMetadata("compiler/testData/loadKotlin/constructor") + @InnerTestClasses({Constructor.Vararg.class}) + public static class Constructor extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInConstructor() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/constructor"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("Constructor0.kt") + public void testConstructor0() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/Constructor0.kt"); + } + + @TestMetadata("Constructor1.kt") + public void testConstructor1() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/Constructor1.kt"); + } + + @TestMetadata("Constructor1WithParamDefaultValue.kt") + public void testConstructor1WithParamDefaultValue() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/Constructor1WithParamDefaultValue.kt"); + } + + @TestMetadata("Constructor2WithOneParamDefaultValue.kt") + public void testConstructor2WithOneParamDefaultValue() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/Constructor2WithOneParamDefaultValue.kt"); + } + + @TestMetadata("ConstructorCollectionParameter.kt") + public void testConstructorCollectionParameter() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/ConstructorCollectionParameter.kt"); + } + + @TestMetadata("ConstructorWithTwoDefArgs.kt") + public void testConstructorWithTwoDefArgs() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTwoDefArgs.kt"); + } + + @TestMetadata("ConstructorWithTwoTypeParameters.kt") + public void testConstructorWithTwoTypeParameters() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParameters.kt"); + } + + @TestMetadata("ConstructorWithTwoTypeParametersAndOneIntValueParameter.kt") + public void testConstructorWithTwoTypeParametersAndOneIntValueParameter() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOneIntValueParameter.kt"); + } + + @TestMetadata("ConstructorWithTwoTypeParametersAndOnePValueParameter.kt") + public void testConstructorWithTwoTypeParametersAndOnePValueParameter() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTwoTypeParametersAndOnePValueParameter.kt"); + } + + @TestMetadata("ConstructorWithTypeParameter.kt") + public void testConstructorWithTypeParameter() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParameter.kt"); + } + + @TestMetadata("ConstructorWithTypeParametersEAndOnePValueParameter.kt") + public void testConstructorWithTypeParametersEAndOnePValueParameter() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/ConstructorWithTypeParametersEAndOnePValueParameter.kt"); + } + + @TestMetadata("InnerClassConstructorWithDefArgs.kt") + public void testInnerClassConstructorWithDefArgs() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/InnerClassConstructorWithDefArgs.kt"); + } + + @TestMetadata("PrivateConstructor1WithParamDefaultValue.kt") + public void testPrivateConstructor1WithParamDefaultValue() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/PrivateConstructor1WithParamDefaultValue.kt"); + } + + @TestMetadata("compiler/testData/loadKotlin/constructor/vararg") + public static class Vararg extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInVararg() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/constructor/vararg"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ConstructorNonLastVararg.kt") + public void testConstructorNonLastVararg() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/vararg/ConstructorNonLastVararg.kt"); + } + + @TestMetadata("ConstructorVararg.kt") + public void testConstructorVararg() throws Exception { + doTest("compiler/testData/loadKotlin/constructor/vararg/ConstructorVararg.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Constructor"); + suite.addTestSuite(Constructor.class); + suite.addTestSuite(Vararg.class); + return suite; + } + } + + @TestMetadata("compiler/testData/loadKotlin/dataClass") + public static class DataClass extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInDataClass() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/dataClass"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("MixedComponents.kt") + public void testMixedComponents() throws Exception { + doTest("compiler/testData/loadKotlin/dataClass/MixedComponents.kt"); + } + + @TestMetadata("NoComponents.kt") + public void testNoComponents() throws Exception { + doTest("compiler/testData/loadKotlin/dataClass/NoComponents.kt"); + } + + @TestMetadata("OneVal.kt") + public void testOneVal() throws Exception { + doTest("compiler/testData/loadKotlin/dataClass/OneVal.kt"); + } + + @TestMetadata("OpenDataClass.kt") + public void testOpenDataClass() throws Exception { + doTest("compiler/testData/loadKotlin/dataClass/OpenDataClass.kt"); + } + + @TestMetadata("OpenPropertyFinalComponent.kt") + public void testOpenPropertyFinalComponent() throws Exception { + doTest("compiler/testData/loadKotlin/dataClass/OpenPropertyFinalComponent.kt"); + } + + @TestMetadata("TwoVals.kt") + public void testTwoVals() throws Exception { + doTest("compiler/testData/loadKotlin/dataClass/TwoVals.kt"); + } + + @TestMetadata("TwoVars.kt") + public void testTwoVars() throws Exception { + doTest("compiler/testData/loadKotlin/dataClass/TwoVars.kt"); + } + + } + + @TestMetadata("compiler/testData/loadKotlin/fun") + @InnerTestClasses({Fun.GenericWithTypeVariables.class, Fun.GenericWithoutTypeVariables.class, Fun.NonGeneric.class, Fun.Vararg.class}) + public static class Fun extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInFun() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("InheritMethodsDifferentReturnTypesAndVisibilities.kt") + public void testInheritMethodsDifferentReturnTypesAndVisibilities() throws Exception { + doTest("compiler/testData/loadKotlin/fun/InheritMethodsDifferentReturnTypesAndVisibilities.kt"); + } + + @TestMetadata("InheritValAndVar.kt") + public void testInheritValAndVar() throws Exception { + doTest("compiler/testData/loadKotlin/fun/InheritValAndVar.kt"); + } + + @TestMetadata("InheritValsDifferentTypes.kt") + public void testInheritValsDifferentTypes() throws Exception { + doTest("compiler/testData/loadKotlin/fun/InheritValsDifferentTypes.kt"); + } + + @TestMetadata("NoSamAdapter.kt") + public void testNoSamAdapter() throws Exception { + doTest("compiler/testData/loadKotlin/fun/NoSamAdapter.kt"); + } + + @TestMetadata("NoSamConstructor.kt") + public void testNoSamConstructor() throws Exception { + doTest("compiler/testData/loadKotlin/fun/NoSamConstructor.kt"); + } + + @TestMetadata("PropagateDeepSubclass.kt") + public void testPropagateDeepSubclass() throws Exception { + doTest("compiler/testData/loadKotlin/fun/PropagateDeepSubclass.kt"); + } + + @TestMetadata("PropagateSubclassOfComparable.kt") + public void testPropagateSubclassOfComparable() throws Exception { + doTest("compiler/testData/loadKotlin/fun/PropagateSubclassOfComparable.kt"); + } + + @TestMetadata("compiler/testData/loadKotlin/fun/genericWithTypeVariables") + public static class GenericWithTypeVariables extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInGenericWithTypeVariables() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun/genericWithTypeVariables"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("FunGenericParam.kt") + public void testFunGenericParam() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunGenericParam.kt"); + } + + @TestMetadata("FunParamParam.kt") + public void testFunParamParam() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParam.kt"); + } + + @TestMetadata("FunParamParamErased.kt") + public void testFunParamParamErased() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamParamErased.kt"); + } + + @TestMetadata("FunParamReferencesParam.kt") + public void testFunParamReferencesParam() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamReferencesParam.kt"); + } + + @TestMetadata("FunParamTwoUpperBounds.kt") + public void testFunParamTwoUpperBounds() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamTwoUpperBounds.kt"); + } + + @TestMetadata("FunParamUpperClassBound.kt") + public void testFunParamUpperClassBound() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassBound.kt"); + } + + @TestMetadata("FunParamUpperClassInterfaceBound.kt") + public void testFunParamUpperClassInterfaceBound() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperClassInterfaceBound.kt"); + } + + @TestMetadata("FunParamUpperInterfaceBound.kt") + public void testFunParamUpperInterfaceBound() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamUpperInterfaceBound.kt"); + } + + @TestMetadata("FunParamVaragParam.kt") + public void testFunParamVaragParam() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunParamVaragParam.kt"); + } + + @TestMetadata("FunTwoTypeParams.kt") + public void testFunTwoTypeParams() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithTypeVariables/FunTwoTypeParams.kt"); + } + + } + + @TestMetadata("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables") + public static class GenericWithoutTypeVariables extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInGenericWithoutTypeVariables() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("FunClassParamNotNull.kt") + public void testFunClassParamNotNull() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNotNull.kt"); + } + + @TestMetadata("FunClassParamNullable.kt") + public void testFunClassParamNullable() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunClassParamNullable.kt"); + } + + @TestMetadata("FunParamNullable.kt") + public void testFunParamNullable() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/FunParamNullable.kt"); + } + + @TestMetadata("ReturnTypeClassParamNotNull.kt") + public void testReturnTypeClassParamNotNull() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNotNull.kt"); + } + + @TestMetadata("ReturnTypeClassParamNullable.kt") + public void testReturnTypeClassParamNullable() throws Exception { + doTest("compiler/testData/loadKotlin/fun/genericWithoutTypeVariables/ReturnTypeClassParamNullable.kt"); + } + + } + + @TestMetadata("compiler/testData/loadKotlin/fun/nonGeneric") + public static class NonGeneric extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInNonGeneric() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun/nonGeneric"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ClassFun.kt") + public void testClassFun() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ClassFun.kt"); + } + + @TestMetadata("ClassFunGetFoo.kt") + public void testClassFunGetFoo() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFoo.kt"); + } + + @TestMetadata("ClassFunGetFooSetFoo.kt") + public void testClassFunGetFooSetFoo() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunGetFooSetFoo.kt"); + } + + @TestMetadata("ClassFunSetFoo.kt") + public void testClassFunSetFoo() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ClassFunSetFoo.kt"); + } + + @TestMetadata("ExtFun.kt") + public void testExtFun() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ExtFun.kt"); + } + + @TestMetadata("ExtFunInClass.kt") + public void testExtFunInClass() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ExtFunInClass.kt"); + } + + @TestMetadata("FunDefaultArg.kt") + public void testFunDefaultArg() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/FunDefaultArg.kt"); + } + + @TestMetadata("FunParamNotNull.kt") + public void testFunParamNotNull() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/FunParamNotNull.kt"); + } + + @TestMetadata("FunVarargInt.kt") + public void testFunVarargInt() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInt.kt"); + } + + @TestMetadata("FunVarargInteger.kt") + public void testFunVarargInteger() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/FunVarargInteger.kt"); + } + + @TestMetadata("ModifierAbstract.kt") + public void testModifierAbstract() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ModifierAbstract.kt"); + } + + @TestMetadata("ModifierOpen.kt") + public void testModifierOpen() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ModifierOpen.kt"); + } + + @TestMetadata("NsFun.kt") + public void testNsFun() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/NsFun.kt"); + } + + @TestMetadata("NsFunGetFoo.kt") + public void testNsFunGetFoo() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/NsFunGetFoo.kt"); + } + + @TestMetadata("ReturnTypeNotNull.kt") + public void testReturnTypeNotNull() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNotNull.kt"); + } + + @TestMetadata("ReturnTypeNullable.kt") + public void testReturnTypeNullable() throws Exception { + doTest("compiler/testData/loadKotlin/fun/nonGeneric/ReturnTypeNullable.kt"); + } + + } + + @TestMetadata("compiler/testData/loadKotlin/fun/vararg") + public static class Vararg extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInVararg() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/fun/vararg"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("nonLastVararg.kt") + public void testNonLastVararg() throws Exception { + doTest("compiler/testData/loadKotlin/fun/vararg/nonLastVararg.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Fun"); + suite.addTestSuite(Fun.class); + suite.addTestSuite(GenericWithTypeVariables.class); + suite.addTestSuite(GenericWithoutTypeVariables.class); + suite.addTestSuite(NonGeneric.class); + suite.addTestSuite(Vararg.class); + return suite; + } + } + + @TestMetadata("compiler/testData/loadKotlin/prop") + @InnerTestClasses({Prop.DefaultAccessors.class}) + public static class Prop extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInProp() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/prop"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ClassVal.kt") + public void testClassVal() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ClassVal.kt"); + } + + @TestMetadata("ClassValAbstract.kt") + public void testClassValAbstract() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ClassValAbstract.kt"); + } + + @TestMetadata("ClassVar.kt") + public void testClassVar() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ClassVar.kt"); + } + + @TestMetadata("CollectionSize.kt") + public void testCollectionSize() throws Exception { + doTest("compiler/testData/loadKotlin/prop/CollectionSize.kt"); + } + + @TestMetadata("ExtValClass.kt") + public void testExtValClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValClass.kt"); + } + + @TestMetadata("ExtValInClass.kt") + public void testExtValInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValInClass.kt"); + } + + @TestMetadata("ExtValInt.kt") + public void testExtValInt() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValInt.kt"); + } + + @TestMetadata("ExtValIntCharSequence.kt") + public void testExtValIntCharSequence() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValIntCharSequence.kt"); + } + + @TestMetadata("ExtValIntCharSequenceQ.kt") + public void testExtValIntCharSequenceQ() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValIntCharSequenceQ.kt"); + } + + @TestMetadata("ExtValIntListQOfIntInClass.kt") + public void testExtValIntListQOfIntInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValIntListQOfIntInClass.kt"); + } + + @TestMetadata("ExtValIntTInClass.kt") + public void testExtValIntTInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValIntTInClass.kt"); + } + + @TestMetadata("ExtValIntTQInClass.kt") + public void testExtValIntTQInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValIntTQInClass.kt"); + } + + @TestMetadata("ExtValTIntInClass.kt") + public void testExtValTIntInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtValTIntInClass.kt"); + } + + @TestMetadata("ExtVarClass.kt") + public void testExtVarClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarClass.kt"); + } + + @TestMetadata("ExtVarInClass.kt") + public void testExtVarInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarInClass.kt"); + } + + @TestMetadata("ExtVarInt.kt") + public void testExtVarInt() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarInt.kt"); + } + + @TestMetadata("ExtVarIntTInClass.kt") + public void testExtVarIntTInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarIntTInClass.kt"); + } + + @TestMetadata("ExtVarIntTQInClass.kt") + public void testExtVarIntTQInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarIntTQInClass.kt"); + } + + @TestMetadata("ExtVarMapPQInt.kt") + public void testExtVarMapPQInt() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarMapPQInt.kt"); + } + + @TestMetadata("ExtVarTIntInClass.kt") + public void testExtVarTIntInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarTIntInClass.kt"); + } + + @TestMetadata("ExtVarTQIntInClass.kt") + public void testExtVarTQIntInClass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarTQIntInClass.kt"); + } + + @TestMetadata("ExtVarl.kt") + public void testExtVarl() throws Exception { + doTest("compiler/testData/loadKotlin/prop/ExtVarl.kt"); + } + + @TestMetadata("NsVal.kt") + public void testNsVal() throws Exception { + doTest("compiler/testData/loadKotlin/prop/NsVal.kt"); + } + + @TestMetadata("NsVar.kt") + public void testNsVar() throws Exception { + doTest("compiler/testData/loadKotlin/prop/NsVar.kt"); + } + + @TestMetadata("OverrideClassVal.kt") + public void testOverrideClassVal() throws Exception { + doTest("compiler/testData/loadKotlin/prop/OverrideClassVal.kt"); + } + + @TestMetadata("OverrideTraitVal.kt") + public void testOverrideTraitVal() throws Exception { + doTest("compiler/testData/loadKotlin/prop/OverrideTraitVal.kt"); + } + + @TestMetadata("PropFromSuperclass.kt") + public void testPropFromSuperclass() throws Exception { + doTest("compiler/testData/loadKotlin/prop/PropFromSuperclass.kt"); + } + + @TestMetadata("TraitFinalVar.kt") + public void testTraitFinalVar() throws Exception { + doTest("compiler/testData/loadKotlin/prop/TraitFinalVar.kt"); + } + + @TestMetadata("TraitOpenVal.kt") + public void testTraitOpenVal() throws Exception { + doTest("compiler/testData/loadKotlin/prop/TraitOpenVal.kt"); + } + + @TestMetadata("VarDelegationToTraitImpl.kt") + public void testVarDelegationToTraitImpl() throws Exception { + doTest("compiler/testData/loadKotlin/prop/VarDelegationToTraitImpl.kt"); + } + + @TestMetadata("compiler/testData/loadKotlin/prop/defaultAccessors") + public static class DefaultAccessors extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInDefaultAccessors() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/prop/defaultAccessors"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("ClassVal.kt") + public void testClassVal() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVal.kt"); + } + + @TestMetadata("ClassValParams.kt") + public void testClassValParams() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ClassValParams.kt"); + } + + @TestMetadata("ClassValWithGet.kt") + public void testClassValWithGet() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ClassValWithGet.kt"); + } + + @TestMetadata("ClassVar.kt") + public void testClassVar() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVar.kt"); + } + + @TestMetadata("ClassVarModality.kt") + public void testClassVarModality() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarModality.kt"); + } + + @TestMetadata("ClassVarParams.kt") + public void testClassVarParams() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarParams.kt"); + } + + @TestMetadata("ClassVarWithGet.kt") + public void testClassVarWithGet() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithGet.kt"); + } + + @TestMetadata("ClassVarWithSet.kt") + public void testClassVarWithSet() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ClassVarWithSet.kt"); + } + + @TestMetadata("ExtValLong.kt") + public void testExtValLong() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ExtValLong.kt"); + } + + @TestMetadata("ExtVarLong.kt") + public void testExtVarLong() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLong.kt"); + } + + @TestMetadata("ExtVarLongWithSet.kt") + public void testExtVarLongWithSet() throws Exception { + doTest("compiler/testData/loadKotlin/prop/defaultAccessors/ExtVarLongWithSet.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Prop"); + suite.addTestSuite(Prop.class); + suite.addTestSuite(DefaultAccessors.class); + return suite; + } + } + + @TestMetadata("compiler/testData/loadKotlin/type") + public static class Type extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInType() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/type"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("Any.kt") + public void testAny() throws Exception { + doTest("compiler/testData/loadKotlin/type/Any.kt"); + } + + @TestMetadata("AnyQ.kt") + public void testAnyQ() throws Exception { + doTest("compiler/testData/loadKotlin/type/AnyQ.kt"); + } + + @TestMetadata("ArrayOfInNumber.kt") + public void testArrayOfInNumber() throws Exception { + doTest("compiler/testData/loadKotlin/type/ArrayOfInNumber.kt"); + } + + @TestMetadata("ArrayOfInt.kt") + public void testArrayOfInt() throws Exception { + doTest("compiler/testData/loadKotlin/type/ArrayOfInt.kt"); + } + + @TestMetadata("ArrayOfInteger.kt") + public void testArrayOfInteger() throws Exception { + doTest("compiler/testData/loadKotlin/type/ArrayOfInteger.kt"); + } + + @TestMetadata("ArrayOfOutNumber.kt") + public void testArrayOfOutNumber() throws Exception { + doTest("compiler/testData/loadKotlin/type/ArrayOfOutNumber.kt"); + } + + @TestMetadata("ArrayOfOutT.kt") + public void testArrayOfOutT() throws Exception { + doTest("compiler/testData/loadKotlin/type/ArrayOfOutT.kt"); + } + + @TestMetadata("ArrayOfString.kt") + public void testArrayOfString() throws Exception { + doTest("compiler/testData/loadKotlin/type/ArrayOfString.kt"); + } + + @TestMetadata("Function1IntString.kt") + public void testFunction1IntString() throws Exception { + doTest("compiler/testData/loadKotlin/type/Function1IntString.kt"); + } + + @TestMetadata("Int.kt") + public void testInt() throws Exception { + doTest("compiler/testData/loadKotlin/type/Int.kt"); + } + + @TestMetadata("IntArray.kt") + public void testIntArray() throws Exception { + doTest("compiler/testData/loadKotlin/type/IntArray.kt"); + } + + @TestMetadata("IntQ.kt") + public void testIntQ() throws Exception { + doTest("compiler/testData/loadKotlin/type/IntQ.kt"); + } + + @TestMetadata("jlInteger.kt") + public void testJlInteger() throws Exception { + doTest("compiler/testData/loadKotlin/type/jlInteger.kt"); + } + + @TestMetadata("jlIntegerQ.kt") + public void testJlIntegerQ() throws Exception { + doTest("compiler/testData/loadKotlin/type/jlIntegerQ.kt"); + } + + @TestMetadata("jlNumber.kt") + public void testJlNumber() throws Exception { + doTest("compiler/testData/loadKotlin/type/jlNumber.kt"); + } + + @TestMetadata("jlObject.kt") + public void testJlObject() throws Exception { + doTest("compiler/testData/loadKotlin/type/jlObject.kt"); + } + + @TestMetadata("jlObjectQ.kt") + public void testJlObjectQ() throws Exception { + doTest("compiler/testData/loadKotlin/type/jlObjectQ.kt"); + } + + @TestMetadata("jlString.kt") + public void testJlString() throws Exception { + doTest("compiler/testData/loadKotlin/type/jlString.kt"); + } + + @TestMetadata("jlStringQ.kt") + public void testJlStringQ() throws Exception { + doTest("compiler/testData/loadKotlin/type/jlStringQ.kt"); + } + + @TestMetadata("ListOfAny.kt") + public void testListOfAny() throws Exception { + doTest("compiler/testData/loadKotlin/type/ListOfAny.kt"); + } + + @TestMetadata("ListOfAnyQ.kt") + public void testListOfAnyQ() throws Exception { + doTest("compiler/testData/loadKotlin/type/ListOfAnyQ.kt"); + } + + @TestMetadata("ListOfStar.kt") + public void testListOfStar() throws Exception { + doTest("compiler/testData/loadKotlin/type/ListOfStar.kt"); + } + + @TestMetadata("ListOfString.kt") + public void testListOfString() throws Exception { + doTest("compiler/testData/loadKotlin/type/ListOfString.kt"); + } + + @TestMetadata("ListOfjlString.kt") + public void testListOfjlString() throws Exception { + doTest("compiler/testData/loadKotlin/type/ListOfjlString.kt"); + } + + @TestMetadata("Nothing.kt") + public void testNothing() throws Exception { + doTest("compiler/testData/loadKotlin/type/Nothing.kt"); + } + + @TestMetadata("NothingQ.kt") + public void testNothingQ() throws Exception { + doTest("compiler/testData/loadKotlin/type/NothingQ.kt"); + } + + @TestMetadata("String.kt") + public void testString() throws Exception { + doTest("compiler/testData/loadKotlin/type/String.kt"); + } + + @TestMetadata("StringQ.kt") + public void testStringQ() throws Exception { + doTest("compiler/testData/loadKotlin/type/StringQ.kt"); + } + + @TestMetadata("Unit.kt") + public void testUnit() throws Exception { + doTest("compiler/testData/loadKotlin/type/Unit.kt"); + } + + } + + @TestMetadata("compiler/testData/loadKotlin/visibility") + public static class Visibility extends AbstractDescriptorSerializationTest { + public void testAllFilesPresentInVisibility() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/visibility"), Pattern.compile("^(.+)\\.kt$"), true); + } + + @TestMetadata("InternalAbstractTraitMembersOverridden.kt") + public void testInternalAbstractTraitMembersOverridden() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/InternalAbstractTraitMembersOverridden.kt"); + } + + @TestMetadata("InternalClass.kt") + public void testInternalClass() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/InternalClass.kt"); + } + + @TestMetadata("InternalConstructor.kt") + public void testInternalConstructor() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/InternalConstructor.kt"); + } + + @TestMetadata("InternalTopLevelMembers.kt") + public void testInternalTopLevelMembers() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/InternalTopLevelMembers.kt"); + } + + @TestMetadata("InternalTraitMembers.kt") + public void testInternalTraitMembers() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/InternalTraitMembers.kt"); + } + + @TestMetadata("InternalTraitMembersInherited.kt") + public void testInternalTraitMembersInherited() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/InternalTraitMembersInherited.kt"); + } + + @TestMetadata("PrivateClass.kt") + public void testPrivateClass() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/PrivateClass.kt"); + } + + @TestMetadata("PrivateTopLevelFun.kt") + public void testPrivateTopLevelFun() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/PrivateTopLevelFun.kt"); + } + + @TestMetadata("PrivateTopLevelVal.kt") + public void testPrivateTopLevelVal() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/PrivateTopLevelVal.kt"); + } + + @TestMetadata("TopLevelVarWithPrivateSetter.kt") + public void testTopLevelVarWithPrivateSetter() throws Exception { + doTest("compiler/testData/loadKotlin/visibility/TopLevelVarWithPrivateSetter.kt"); + } + + } + + public static Test suite() { + TestSuite suite = new TestSuite("DescriptorSerializationTestGenerated"); + suite.addTestSuite(DescriptorSerializationTestGenerated.class); + suite.addTestSuite(Class.class); + suite.addTestSuite(ClassFun.class); + suite.addTestSuite(ClassObject.class); + suite.addTest(Constructor.innerSuite()); + suite.addTestSuite(DataClass.class); + suite.addTest(Fun.innerSuite()); + suite.addTest(Prop.innerSuite()); + suite.addTestSuite(Type.class); + suite.addTestSuite(Visibility.class); + return suite; + } +} diff --git a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java index 6ca675699c1..69a8828a89a 100644 --- a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java +++ b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java @@ -31,6 +31,7 @@ import org.jetbrains.jet.completion.AbstractJavaCompletionTest; import org.jetbrains.jet.completion.AbstractJavaWithLibCompletionTest; import org.jetbrains.jet.completion.AbstractJetJSCompletionTest; import org.jetbrains.jet.completion.AbstractKeywordCompletionTest; +import org.jetbrains.jet.descriptors.serialization.AbstractDescriptorSerializationTest; import org.jetbrains.jet.editor.quickDoc.AbstractJetQuickDocProviderTest; import org.jetbrains.jet.findUsages.AbstractJetFindUsagesTest; import org.jetbrains.jet.jvm.compiler.*; @@ -229,6 +230,13 @@ public class GenerateTests { testModel("compiler/testData/modules.xml", true, "xml", "doTest") ); + generateTest( + "compiler/tests/", + "DescriptorSerializationTestGenerated", + AbstractDescriptorSerializationTest.class, + testModel("compiler/testData/loadKotlin") + ); + generateTest( "idea/tests/", "JetPsiMatcherTest",