From 0b1fe9c6118df20b18d7e14fc228dd25eb994dd4 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Sun, 27 Jan 2013 20:53:09 +0400 Subject: [PATCH] Generate black box with java codegen tests --- .../BlackBoxWithJavaCodegenTestGenerated.java | 179 ++++++++++++++++++ .../jet/generators/tests/GenerateTests.java | 7 + 2 files changed, 186 insertions(+) create mode 100644 compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java diff --git a/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java new file mode 100644 index 00000000000..f0b09e83268 --- /dev/null +++ b/compiler/tests/org/jetbrains/jet/codegen/generated/BlackBoxWithJavaCodegenTestGenerated.java @@ -0,0 +1,179 @@ +/* + * Copyright 2010-2012 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.codegen.generated; + +import junit.framework.Assert; +import junit.framework.Test; +import junit.framework.TestSuite; + +import java.io.File; +import org.jetbrains.jet.JetTestUtils; +import org.jetbrains.jet.test.InnerTestClasses; +import org.jetbrains.jet.test.TestMetadata; + +import org.jetbrains.jet.codegen.generated.AbstractBlackBoxCodegenTest; + +/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/codegen/boxWithJava") +@InnerTestClasses({BlackBoxWithJavaCodegenTestGenerated.Enum.class, BlackBoxWithJavaCodegenTestGenerated.Functions.class, BlackBoxWithJavaCodegenTestGenerated.ProtectedStatic.class, BlackBoxWithJavaCodegenTestGenerated.StaticFun.class}) +public class BlackBoxWithJavaCodegenTestGenerated extends AbstractBlackBoxCodegenTest { + public void testAllFilesPresentInBoxWithJava() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/boxWithJava"), "kt", true); + } + + @TestMetadata("compiler/testData/codegen/boxWithJava/enum") + public static class Enum extends AbstractBlackBoxCodegenTest { + public void testAllFilesPresentInEnum() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/boxWithJava/enum"), "kt", true); + } + + @TestMetadata("simpleJavaEnum.kt") + public void testSimpleJavaEnum() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/enum/simpleJavaEnum.kt"); + } + + @TestMetadata("simpleJavaEnumWithFunction.kt") + public void testSimpleJavaEnumWithFunction() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/enum/simpleJavaEnumWithFunction.kt"); + } + + @TestMetadata("simpleJavaEnumWithStaticImport.kt") + public void testSimpleJavaEnumWithStaticImport() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/enum/simpleJavaEnumWithStaticImport.kt"); + } + + @TestMetadata("simpleJavaInnerEnum.kt") + public void testSimpleJavaInnerEnum() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/enum/simpleJavaInnerEnum.kt"); + } + + } + + @TestMetadata("compiler/testData/codegen/boxWithJava/functions") + public static class Functions extends AbstractBlackBoxCodegenTest { + public void testAllFilesPresentInFunctions() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/boxWithJava/functions"), "kt", true); + } + + @TestMetadata("referencesStaticInnerClassMethod.kt") + public void testReferencesStaticInnerClassMethod() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/functions/referencesStaticInnerClassMethod.kt"); + } + + @TestMetadata("referencesStaticInnerClassMethodL2.kt") + public void testReferencesStaticInnerClassMethodL2() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/functions/referencesStaticInnerClassMethodL2.kt"); + } + + @TestMetadata("removeInIterator.kt") + public void testRemoveInIterator() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/functions/removeInIterator.kt"); + } + + } + + @TestMetadata("compiler/testData/codegen/boxWithJava/protectedStatic") + public static class ProtectedStatic extends AbstractBlackBoxCodegenTest { + public void testAllFilesPresentInProtectedStatic() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/boxWithJava/protectedStatic"), "kt", true); + } + + @TestMetadata("funCallInConstructor.kt") + public void testFunCallInConstructor() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/funCallInConstructor.kt"); + } + + @TestMetadata("funClassObject.kt") + public void testFunClassObject() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/funClassObject.kt"); + } + + @TestMetadata("funGenericClass.kt") + public void testFunGenericClass() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/funGenericClass.kt"); + } + + @TestMetadata("funNestedStaticClass.kt") + public void testFunNestedStaticClass() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/funNestedStaticClass.kt"); + } + + @TestMetadata("funNestedStaticClass2.kt") + public void testFunNestedStaticClass2() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/funNestedStaticClass2.kt"); + } + + @TestMetadata("funNestedStaticGenericClass.kt") + public void testFunNestedStaticGenericClass() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/funNestedStaticGenericClass.kt"); + } + + @TestMetadata("funNotDirectSuperClass.kt") + public void testFunNotDirectSuperClass() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/funNotDirectSuperClass.kt"); + } + + @TestMetadata("funObject.kt") + public void testFunObject() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/funObject.kt"); + } + + @TestMetadata("simpleClass.kt") + public void testSimpleClass() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/simpleClass.kt"); + } + + @TestMetadata("simpleClass2.kt") + public void testSimpleClass2() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/simpleClass2.kt"); + } + + @TestMetadata("simpleFun.kt") + public void testSimpleFun() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/simpleFun.kt"); + } + + @TestMetadata("simpleProperty.kt") + public void testSimpleProperty() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/protectedStatic/simpleProperty.kt"); + } + + } + + @TestMetadata("compiler/testData/codegen/boxWithJava/staticFun") + public static class StaticFun extends AbstractBlackBoxCodegenTest { + public void testAllFilesPresentInStaticFun() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("compiler/testData/codegen/boxWithJava/staticFun"), "kt", true); + } + + @TestMetadata("classWithNestedEnum.kt") + public void testClassWithNestedEnum() throws Exception { + blackBoxFileWithJavaByFullPath("compiler/testData/codegen/boxWithJava/staticFun/classWithNestedEnum.kt"); + } + + } + + public static Test suite() { + TestSuite suite = new TestSuite("BlackBoxWithJavaCodegenTestGenerated"); + suite.addTestSuite(BlackBoxWithJavaCodegenTestGenerated.class); + suite.addTestSuite(Enum.class); + suite.addTestSuite(Functions.class); + suite.addTestSuite(ProtectedStatic.class); + suite.addTestSuite(StaticFun.class); + return suite; + } +} diff --git a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java index fc17051c6ea..4b0d3e6887e 100644 --- a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java +++ b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java @@ -70,6 +70,13 @@ public class GenerateTests { testModel("compiler/testData/codegen/box", "blackBoxFileByFullPath") ); + generateTest( + "compiler/tests/", + "BlackBoxWithJavaCodegenTestGenerated", + AbstractBlackBoxCodegenTest.class, + testModel("compiler/testData/codegen/boxWithJava", "blackBoxFileWithJavaByFullPath") + ); + generateTest( "compiler/tests/", "DataClassCodegenTestGenerated",