Don't test annotations in DescriptorSerializationTest
This commit is contained in:
+1
-32
@@ -26,11 +26,9 @@ 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.AnnotationDeserializer;
|
||||
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.resolve.BindingTraceContext;
|
||||
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
||||
@@ -44,7 +42,6 @@ import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe;
|
||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||
import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import org.jetbrains.jet.test.util.NamespaceComparator;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
@@ -62,34 +59,6 @@ public abstract class AbstractDescriptorSerializationTest extends KotlinTestWith
|
||||
|
||||
public static final Name TEST_PACKAGE_NAME = Name.identifier("test");
|
||||
|
||||
public static final AnnotationDeserializer DUMMY_ANNOTATION_DESERIALIZER = new AnnotationDeserializer() {
|
||||
@NotNull
|
||||
@Override
|
||||
public List<AnnotationDescriptor> loadClassAnnotations(@NotNull ClassDescriptor descriptor, @NotNull ProtoBuf.Class classProto) {
|
||||
// TODO: not only data annotations are present in tests
|
||||
AnnotationDescriptor annotationDescriptor = new AnnotationDescriptor();
|
||||
annotationDescriptor.setAnnotationType(KotlinBuiltIns.getInstance().getDataClassAnnotation().getDefaultType());
|
||||
return Collections.singletonList(annotationDescriptor);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<AnnotationDescriptor> loadCallableAnnotations(
|
||||
@NotNull ClassOrNamespaceDescriptor container,
|
||||
@NotNull ProtoBuf.Callable proto,
|
||||
@NotNull NameResolver nameResolver,
|
||||
@NotNull AnnotatedCallableKind kind
|
||||
) {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public List<AnnotationDescriptor> loadValueParameterAnnotations(@NotNull ProtoBuf.Callable.ValueParameter parameterProto) {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected JetCoreEnvironment createEnvironment() {
|
||||
return createEnvironmentWithMockJdk(ConfigurationKind.JDK_ONLY);
|
||||
@@ -280,7 +249,7 @@ public abstract class AbstractDescriptorSerializationTest extends KotlinTestWith
|
||||
}
|
||||
|
||||
return new DeserializedClassDescriptor(classId, new LockBasedStorageManager(), containingDeclaration,
|
||||
classData.getNameResolver(), DUMMY_ANNOTATION_DESERIALIZER, this, classData.getClassProto(), null);
|
||||
classData.getNameResolver(), UNSUPPORTED, this, classData.getClassProto(), null);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+1
-183
@@ -30,144 +30,8 @@ import org.jetbrains.jet.descriptors.serialization.AbstractDescriptorSerializati
|
||||
|
||||
/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */
|
||||
@SuppressWarnings("all")
|
||||
@TestMetadata("compiler/testData/loadKotlin")
|
||||
@InnerTestClasses({DescriptorSerializationTestGenerated.Annotations.class, 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})
|
||||
@InnerTestClasses({DescriptorSerializationTestGenerated.Class.class, DescriptorSerializationTestGenerated.ClassFun.class, DescriptorSerializationTestGenerated.ClassObject.class, DescriptorSerializationTestGenerated.Constructor.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/annotations")
|
||||
@InnerTestClasses({Annotations.ClassMembers.class, Annotations.Classes.class, Annotations.PackageMembers.class})
|
||||
public static class Annotations extends AbstractDescriptorSerializationTest {
|
||||
public void testAllFilesPresentInAnnotations() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/annotations"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadKotlin/annotations/classMembers")
|
||||
public static class ClassMembers extends AbstractDescriptorSerializationTest {
|
||||
public void testAllFilesPresentInClassMembers() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/annotations/classMembers"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("Function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classMembers/Function.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Getter.kt")
|
||||
public void testGetter() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classMembers/Getter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PropertyField.kt")
|
||||
public void testPropertyField() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classMembers/PropertyField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PropertyNoField.kt")
|
||||
public void testPropertyNoField() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classMembers/PropertyNoField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Setter.kt")
|
||||
public void testSetter() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classMembers/Setter.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadKotlin/annotations/classes")
|
||||
public static class Classes extends AbstractDescriptorSerializationTest {
|
||||
public void testAllFilesPresentInClasses() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/annotations/classes"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("ClassInClassObject.kt")
|
||||
public void testClassInClassObject() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classes/ClassInClassObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("ClassObject.kt")
|
||||
public void testClassObject() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classes/ClassObject.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Deprecated.kt")
|
||||
public void testDeprecated() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classes/Deprecated.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("MultipleAnnotations.kt")
|
||||
public void testMultipleAnnotations() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classes/MultipleAnnotations.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("NestedClass.kt")
|
||||
public void testNestedClass() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classes/NestedClass.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classes/Simple.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("WithArgument.kt")
|
||||
public void testWithArgument() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classes/WithArgument.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("WithMultipleArguments.kt")
|
||||
public void testWithMultipleArguments() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/classes/WithMultipleArguments.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadKotlin/annotations/packageMembers")
|
||||
public static class PackageMembers extends AbstractDescriptorSerializationTest {
|
||||
public void testAllFilesPresentInPackageMembers() throws Exception {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/loadKotlin/annotations/packageMembers"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("Function.kt")
|
||||
public void testFunction() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/packageMembers/Function.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Getter.kt")
|
||||
public void testGetter() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/packageMembers/Getter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PropertyField.kt")
|
||||
public void testPropertyField() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/packageMembers/PropertyField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("PropertyNoField.kt")
|
||||
public void testPropertyNoField() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/packageMembers/PropertyNoField.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Setter.kt")
|
||||
public void testSetter() throws Exception {
|
||||
doTest("compiler/testData/loadKotlin/annotations/packageMembers/Setter.kt");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static Test innerSuite() {
|
||||
TestSuite suite = new TestSuite("Annotations");
|
||||
suite.addTestSuite(Annotations.class);
|
||||
suite.addTestSuite(ClassMembers.class);
|
||||
suite.addTestSuite(Classes.class);
|
||||
suite.addTestSuite(PackageMembers.class);
|
||||
return suite;
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/loadKotlin/class")
|
||||
public static class Class extends AbstractDescriptorSerializationTest {
|
||||
public void testAllFilesPresentInClass() throws Exception {
|
||||
@@ -530,49 +394,6 @@ public class DescriptorSerializationTestGenerated extends AbstractDescriptorSeri
|
||||
}
|
||||
}
|
||||
|
||||
@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 {
|
||||
@@ -1259,13 +1080,10 @@ public class DescriptorSerializationTestGenerated extends AbstractDescriptorSeri
|
||||
|
||||
public static Test suite() {
|
||||
TestSuite suite = new TestSuite("DescriptorSerializationTestGenerated");
|
||||
suite.addTestSuite(DescriptorSerializationTestGenerated.class);
|
||||
suite.addTest(Annotations.innerSuite());
|
||||
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);
|
||||
|
||||
@@ -234,7 +234,14 @@ public class GenerateTests {
|
||||
"compiler/tests/",
|
||||
"DescriptorSerializationTestGenerated",
|
||||
AbstractDescriptorSerializationTest.class,
|
||||
testModel("compiler/testData/loadKotlin")
|
||||
testModel("compiler/testData/loadKotlin/class"),
|
||||
testModel("compiler/testData/loadKotlin/classFun"),
|
||||
testModel("compiler/testData/loadKotlin/classObject"),
|
||||
testModel("compiler/testData/loadKotlin/constructor"),
|
||||
testModel("compiler/testData/loadKotlin/fun"),
|
||||
testModel("compiler/testData/loadKotlin/prop"),
|
||||
testModel("compiler/testData/loadKotlin/type"),
|
||||
testModel("compiler/testData/loadKotlin/visibility")
|
||||
);
|
||||
|
||||
generateTest(
|
||||
|
||||
Reference in New Issue
Block a user