diff --git a/compiler/testData/loadJava/compiledJava/EnumMembers.java b/compiler/testData/loadJava/compiledJava/enum/EnumMembers.java similarity index 100% rename from compiler/testData/loadJava/compiledJava/EnumMembers.java rename to compiler/testData/loadJava/compiledJava/enum/EnumMembers.java diff --git a/compiler/testData/loadJava/compiledJava/EnumMembers.txt b/compiler/testData/loadJava/compiledJava/enum/EnumMembers.txt similarity index 100% rename from compiler/testData/loadJava/compiledJava/EnumMembers.txt rename to compiler/testData/loadJava/compiledJava/enum/EnumMembers.txt diff --git a/compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.java b/compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.java new file mode 100644 index 00000000000..e3a2ca79730 --- /dev/null +++ b/compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.java @@ -0,0 +1,13 @@ +package test; + +public enum EnumWithSpecializedEntry { + E1, + + E2 { + String foo() { + return name(); + } + }; + + static class Nested {} +} diff --git a/compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.txt b/compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.txt new file mode 100644 index 00000000000..09c93e4eccb --- /dev/null +++ b/compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.txt @@ -0,0 +1,30 @@ +package test + +public open enum class EnumWithSpecializedEntry : kotlin.Enum { + public enum entry E1 : test.EnumWithSpecializedEntry { + private constructor E1() + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.EnumWithSpecializedEntry!): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + } + + public enum entry E2 : test.EnumWithSpecializedEntry { + private constructor E2() + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.EnumWithSpecializedEntry!): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + } + + private constructor EnumWithSpecializedEntry() + public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: test.EnumWithSpecializedEntry!): kotlin.Int + public final override /*1*/ /*fake_override*/ fun name(): kotlin.String + public final override /*1*/ /*fake_override*/ fun ordinal(): kotlin.Int + + public/*package*/ open class Nested { + public/*package*/ constructor Nested() + } + + // Static members + public final /*synthesized*/ fun valueOf(/*0*/ value: kotlin.String): test.EnumWithSpecializedEntry + public final /*synthesized*/ fun values(): kotlin.Array +} diff --git a/compiler/testData/loadJava/compiledJava/JavaEnum.java b/compiler/testData/loadJava/compiledJava/enum/JavaEnum.java similarity index 100% rename from compiler/testData/loadJava/compiledJava/JavaEnum.java rename to compiler/testData/loadJava/compiledJava/enum/JavaEnum.java diff --git a/compiler/testData/loadJava/compiledJava/JavaEnum.txt b/compiler/testData/loadJava/compiledJava/enum/JavaEnum.txt similarity index 100% rename from compiler/testData/loadJava/compiledJava/JavaEnum.txt rename to compiler/testData/loadJava/compiledJava/enum/JavaEnum.txt diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java index d2daa551cc5..ac8cce81e13 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/LoadJavaTestGenerated.java @@ -45,6 +45,7 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { @InnerTestClasses({ CompiledJava.Annotations.class, CompiledJava.Constructor.class, + CompiledJava.Enum.class, CompiledJava.JavaBean.class, CompiledJava.KotlinSignature.class, CompiledJava.Library.class, @@ -119,12 +120,6 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { doTestCompiledJava(fileName); } - @TestMetadata("EnumMembers.java") - public void testEnumMembers() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/EnumMembers.java"); - doTestCompiledJava(fileName); - } - @TestMetadata("FieldAsVar.java") public void testFieldAsVar() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/FieldAsVar.java"); @@ -179,12 +174,6 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { doTestCompiledJava(fileName); } - @TestMetadata("JavaEnum.java") - public void testJavaEnum() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/JavaEnum.java"); - doTestCompiledJava(fileName); - } - @TestMetadata("MethodReferencesOuterClassTP.java") public void testMethodReferencesOuterClassTP() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethodReferencesOuterClassTP.java"); @@ -503,6 +492,33 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest { } } + @TestMetadata("compiler/testData/loadJava/compiledJava/enum") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Enum extends AbstractLoadJavaTest { + public void testAllFilesPresentInEnum() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/enum"), Pattern.compile("^(.+)\\.java$"), true); + } + + @TestMetadata("EnumMembers.java") + public void testEnumMembers() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/EnumMembers.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("EnumWithSpecializedEntry.java") + public void testEnumWithSpecializedEntry() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.java"); + doTestCompiledJava(fileName); + } + + @TestMetadata("JavaEnum.java") + public void testJavaEnum() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/JavaEnum.java"); + doTestCompiledJava(fileName); + } + } + @TestMetadata("compiler/testData/loadJava/compiledJava/javaBean") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java index 219772b67d8..dc5cc773b28 100644 --- a/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/jvm/runtime/JvmRuntimeDescriptorLoaderTestGenerated.java @@ -3094,6 +3094,7 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD @InnerTestClasses({ CompiledJava.Annotations.class, CompiledJava.Constructor.class, + CompiledJava.Enum.class, CompiledJava.JavaBean.class, CompiledJava.KotlinSignature.class, CompiledJava.Library.class, @@ -3167,12 +3168,6 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD doTest(fileName); } - @TestMetadata("EnumMembers.java") - public void testEnumMembers() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/EnumMembers.java"); - doTest(fileName); - } - @TestMetadata("FieldAsVar.java") public void testFieldAsVar() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/FieldAsVar.java"); @@ -3227,12 +3222,6 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD doTest(fileName); } - @TestMetadata("JavaEnum.java") - public void testJavaEnum() throws Exception { - String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/JavaEnum.java"); - doTest(fileName); - } - @TestMetadata("MethodReferencesOuterClassTP.java") public void testMethodReferencesOuterClassTP() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/MethodReferencesOuterClassTP.java"); @@ -3551,6 +3540,33 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD } } + @TestMetadata("compiler/testData/loadJava/compiledJava/enum") + @TestDataPath("$PROJECT_ROOT") + @RunWith(JUnit3RunnerWithInners.class) + public static class Enum extends AbstractJvmRuntimeDescriptorLoaderTest { + public void testAllFilesPresentInEnum() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/loadJava/compiledJava/enum"), Pattern.compile("^(.+)\\.java$"), true); + } + + @TestMetadata("EnumMembers.java") + public void testEnumMembers() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/EnumMembers.java"); + doTest(fileName); + } + + @TestMetadata("EnumWithSpecializedEntry.java") + public void testEnumWithSpecializedEntry() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/EnumWithSpecializedEntry.java"); + doTest(fileName); + } + + @TestMetadata("JavaEnum.java") + public void testJavaEnum() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/loadJava/compiledJava/enum/JavaEnum.java"); + doTest(fileName); + } + } + @TestMetadata("compiler/testData/loadJava/compiledJava/javaBean") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)