diff --git a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java index 68533db3581..68c4d40eb4b 100644 --- a/generators/org/jetbrains/jet/generators/tests/GenerateTests.java +++ b/generators/org/jetbrains/jet/generators/tests/GenerateTests.java @@ -32,6 +32,7 @@ import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveDescriptorRenderer import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveNamespaceComparingTest; import org.jetbrains.jet.lang.resolve.lazy.AbstractLazyResolveTest; import org.jetbrains.jet.plugin.highlighter.AbstractDeprecatedHighlightingTest; +import org.jetbrains.jet.plugin.quickfix.AbstractQuickFixTest; import org.jetbrains.jet.test.generator.SimpleTestClassModel; import org.jetbrains.jet.test.generator.TestClassModel; import org.jetbrains.jet.test.generator.TestGenerator; @@ -201,6 +202,13 @@ public class GenerateTests { testModel("idea/testData/checker/infos", false, "kt", "doTestWithInfos") ); + generateTest( + "idea/tests/", + "QuickFixTestGenerated", + AbstractQuickFixTest.class, + new SimpleTestClassModel(new File("idea/testData/quickfix"), true, Pattern.compile("^before(\\w+)\\.kt$"), "doTest") + ); + generateTest( "idea/tests/", "DeprecatedHighlightingTestGenerated", diff --git a/idea/tests/org/jetbrains/jet/plugin/quickfix/JetQuickFixTest.java b/idea/tests/org/jetbrains/jet/plugin/quickfix/AbstractQuickFixTest.java similarity index 52% rename from idea/tests/org/jetbrains/jet/plugin/quickfix/JetQuickFixTest.java rename to idea/tests/org/jetbrains/jet/plugin/quickfix/AbstractQuickFixTest.java index a720ccfd612..64e7301aa07 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/JetQuickFixTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/AbstractQuickFixTest.java @@ -21,82 +21,25 @@ import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.openapi.projectRoots.JavaSdk; import com.intellij.openapi.projectRoots.Sdk; import com.intellij.openapi.util.Pair; -import junit.framework.Test; -import junit.framework.TestSuite; import org.apache.commons.lang.SystemUtils; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.JetTestCaseBuilder; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.plugin.PluginTestCaseBase; +import org.jetbrains.jet.test.TestMetadata; import org.jetbrains.jet.testing.ConfigLibraryUtil; -import java.io.File; -import java.io.FilenameFilter; -import java.util.Arrays; -import java.util.Collections; import java.util.List; -@SuppressWarnings("JUnitTestCaseWithNoTests") -public class JetQuickFixTest extends LightQuickFixTestCase { - private final String dataPath; - private final String name; - - @SuppressWarnings("JUnitTestCaseWithNonTrivialConstructors") - public JetQuickFixTest(String dataPath, String name) { - this.dataPath = dataPath; - this.name = name; - } - - public static Test suite() { - TestSuite suite = new TestSuite(); - - FilenameFilter singleFileNameFilter = new FilenameFilter() { - @Override - public boolean accept(File file, String s) { - return s.startsWith("before") && !QuickFixMultifileTest.isMultiFileName(s); - } - }; - - JetTestCaseBuilder.NamedTestFactory singleFileNamedTestFactory = new JetTestCaseBuilder.NamedTestFactory() { - @NotNull - @Override - public Test createTest(@NotNull String dataPath, @NotNull String name, @NotNull File file) { - return new JetQuickFixTest(dataPath, name); - } - }; - - File dir = new File(getTestDataPathBase()); - List subDirs = Arrays.asList(dir.list()); - Collections.sort(subDirs); - for (String subDirName : subDirs) { - final TestSuite singleFileTestSuite = JetTestCaseBuilder - .suiteForDirectory(getTestDataPathBase(), subDirName, true, singleFileNameFilter, singleFileNamedTestFactory); - if (singleFileTestSuite.countTestCases() != 0) { - suite.addTest(singleFileTestSuite); - } - } - return suite; - } - - public static String getTestDataPathBase() { - return JetTestCaseBuilder.getHomeDirectory() + "/idea/testData/quickfix/"; - } - - @Override - public String getName() { - return "test" + name.replaceFirst(name.substring(0, 1), name.substring(0, 1).toUpperCase()); - } - - @Override - protected void runTest() throws Throwable { - boolean isWithRuntime = name.endsWith("Runtime"); +public abstract class AbstractQuickFixTest extends LightQuickFixTestCase { + protected void doTest(@NotNull String beforeFileName) throws Exception { + boolean isWithRuntime = beforeFileName.endsWith("Runtime.kt"); if (isWithRuntime) { ConfigLibraryUtil.configureKotlinRuntime(getModule(), getFullJavaJDK()); } try { - doSingleTest(name.substring("before".length()) + ".kt"); + doSingleTest(getTestName(false) + ".kt"); checkAvailableActionsAreExpected(); checkForUnexpectedErrors(); } @@ -122,13 +65,13 @@ public class JetQuickFixTest extends LightQuickFixTestCase { @Override protected String getBasePath() { - return "/quickfix/" + dataPath; + return getClass().getAnnotation(TestMetadata.class).value(); } @NotNull @Override protected String getTestDataPath() { - return PluginTestCaseBase.getTestDataPathBase(); + return "./"; } @Override diff --git a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultifileTest.java b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultifileTest.java index 5b02609f75b..494fa7735dc 100644 --- a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultifileTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixMultifileTest.java @@ -127,10 +127,6 @@ public class QuickFixMultifileTest extends AbstractQuickFixMultiFileTest { return PluginTestCaseBase.jdkFromIdeaHome(); } - public static boolean isMultiFileName(String fileName) { - return fileName.contains(MAIN_SUBSTRING) || fileName.contains(DATA_SUBSTRING); - } - public static boolean isMainFile(String fileName) { return fileName.contains(MAIN_SUBSTRING); } @@ -141,7 +137,7 @@ public class QuickFixMultifileTest extends AbstractQuickFixMultiFileTest { FilenameFilter multifileFileNameFilter = new FilenameFilter() { @Override public boolean accept(File file, String s) { - return s.startsWith("before") && QuickFixMultifileTest.isMainFile(s); + return s.startsWith("before") && isMainFile(s); } }; diff --git a/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java new file mode 100644 index 00000000000..755779b38e1 --- /dev/null +++ b/idea/tests/org/jetbrains/jet/plugin/quickfix/QuickFixTestGenerated.java @@ -0,0 +1,819 @@ +/* + * 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.plugin.quickfix; + +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.plugin.quickfix.AbstractQuickFixTest; + +/** This class is generated by {@link org.jetbrains.jet.generators.tests.GenerateTests}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("idea/testData/quickfix") +@InnerTestClasses({QuickFixTestGenerated.Abstract.class, QuickFixTestGenerated.AddStarProjections.class, QuickFixTestGenerated.AutoImports.class, QuickFixTestGenerated.Expressions.class, QuickFixTestGenerated.Migration.class, QuickFixTestGenerated.Modifiers.class, QuickFixTestGenerated.Nullables.class, QuickFixTestGenerated.Override.class, QuickFixTestGenerated.TypeAddition.class, QuickFixTestGenerated.TypeImports.class, QuickFixTestGenerated.TypeProjection.class, QuickFixTestGenerated.UselessImports.class, QuickFixTestGenerated.Variables.class, QuickFixTestGenerated.When.class}) +public class QuickFixTestGenerated extends AbstractQuickFixTest { + public void testAllFilesPresentInQuickfix() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/quickfix/abstract") + public static class Abstract extends AbstractQuickFixTest { + @TestMetadata("beforeAbstractFunctionInNonAbstractClass.kt") + public void testAbstractFunctionInNonAbstractClass() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractFunctionInNonAbstractClass.kt"); + } + + @TestMetadata("beforeAbstractFunctionWithBody.kt") + public void testAbstractFunctionWithBody() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractFunctionWithBody.kt"); + } + + @TestMetadata("beforeAbstractFunctionWithBody2.kt") + public void testAbstractFunctionWithBody2() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractFunctionWithBody2.kt"); + } + + @TestMetadata("beforeAbstractFunctionWithBody3.kt") + public void testAbstractFunctionWithBody3() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractFunctionWithBody3.kt"); + } + + @TestMetadata("beforeAbstractPropertyInNonAbstractClass1.kt") + public void testAbstractPropertyInNonAbstractClass1() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyInNonAbstractClass1.kt"); + } + + @TestMetadata("beforeAbstractPropertyInNonAbstractClass2.kt") + public void testAbstractPropertyInNonAbstractClass2() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyInNonAbstractClass2.kt"); + } + + @TestMetadata("beforeAbstractPropertyInPrimaryConstructorParameters.kt") + public void testAbstractPropertyInPrimaryConstructorParameters() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyInPrimaryConstructorParameters.kt"); + } + + @TestMetadata("beforeAbstractPropertyNotInClass.kt") + public void testAbstractPropertyNotInClass() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyNotInClass.kt"); + } + + @TestMetadata("beforeAbstractPropertyWIthInitializer2.kt") + public void testAbstractPropertyWIthInitializer2() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyWIthInitializer2.kt"); + } + + @TestMetadata("beforeAbstractPropertyWIthInitializer3.kt") + public void testAbstractPropertyWIthInitializer3() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyWIthInitializer3.kt"); + } + + @TestMetadata("beforeAbstractPropertyWithGetter1.kt") + public void testAbstractPropertyWithGetter1() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyWithGetter1.kt"); + } + + @TestMetadata("beforeAbstractPropertyWithGetter2.kt") + public void testAbstractPropertyWithGetter2() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyWithGetter2.kt"); + } + + @TestMetadata("beforeAbstractPropertyWithInitializer1.kt") + public void testAbstractPropertyWithInitializer1() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyWithInitializer1.kt"); + } + + @TestMetadata("beforeAbstractPropertyWithSetter.kt") + public void testAbstractPropertyWithSetter() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeAbstractPropertyWithSetter.kt"); + } + + public void testAllFilesPresentInAbstract() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/abstract"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeMustBeInitializedOrBeAbstract.kt") + public void testMustBeInitializedOrBeAbstract() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeMustBeInitializedOrBeAbstract.kt"); + } + + @TestMetadata("beforeNonAbstractFunctionWithNoBody.kt") + public void testNonAbstractFunctionWithNoBody() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeNonAbstractFunctionWithNoBody.kt"); + } + + @TestMetadata("beforeNonMemberAbstractFunction.kt") + public void testNonMemberAbstractFunction() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeNonMemberAbstractFunction.kt"); + } + + @TestMetadata("beforeNonMemberFunctionNoBody.kt") + public void testNonMemberFunctionNoBody() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeNonMemberFunctionNoBody.kt"); + } + + @TestMetadata("beforeRedundantAbstract.kt") + public void testRedundantAbstract() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeRedundantAbstract.kt"); + } + + @TestMetadata("beforeReplaceOpen.kt") + public void testReplaceOpen() throws Exception { + doTest("idea/testData/quickfix/abstract/beforeReplaceOpen.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/addStarProjections") + @InnerTestClasses({AddStarProjections.JavaClass.class, AddStarProjections.When.class}) + public static class AddStarProjections extends AbstractQuickFixTest { + public void testAllFilesPresentInAddStarProjections() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/addStarProjections"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeQualifiedArrayList.kt") + public void testQualifiedArrayList() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/beforeQualifiedArrayList.kt"); + } + + @TestMetadata("beforeQualifiedList.kt") + public void testQualifiedList() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/beforeQualifiedList.kt"); + } + + @TestMetadata("beforeQualifiedMap.kt") + public void testQualifiedMap() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/beforeQualifiedMap.kt"); + } + + @TestMetadata("beforeUnqualifiedList.kt") + public void testUnqualifiedList() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/beforeUnqualifiedList.kt"); + } + + @TestMetadata("beforeUnqualifiedMap.kt") + public void testUnqualifiedMap() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/beforeUnqualifiedMap.kt"); + } + + @TestMetadata("beforeUnqualifiedMapOneArg.kt") + public void testUnqualifiedMapOneArg() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/beforeUnqualifiedMapOneArg.kt"); + } + + @TestMetadata("idea/testData/quickfix/addStarProjections/javaClass") + public static class JavaClass extends AbstractQuickFixTest { + public void testAllFilesPresentInJavaClass() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/addStarProjections/javaClass"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeFooOfC2.kt") + public void testFooOfC2() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/javaClass/beforeFooOfC2.kt"); + } + + @TestMetadata("beforeJavaClassOfC1Runtime.kt") + public void testJavaClassOfC1Runtime() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/javaClass/beforeJavaClassOfC1Runtime.kt"); + } + + @TestMetadata("beforeJavaClassOfC2Runtime.kt") + public void testJavaClassOfC2Runtime() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/javaClass/beforeJavaClassOfC2Runtime.kt"); + } + + @TestMetadata("beforeJavaClassOfCRuntime.kt") + public void testJavaClassOfCRuntime() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/javaClass/beforeJavaClassOfCRuntime.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/addStarProjections/when") + public static class When extends AbstractQuickFixTest { + public void testAllFilesPresentInWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/addStarProjections/when"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeQualifiedArrayList.kt") + public void testQualifiedArrayList() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/when/beforeQualifiedArrayList.kt"); + } + + @TestMetadata("beforeQualifiedList.kt") + public void testQualifiedList() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/when/beforeQualifiedList.kt"); + } + + @TestMetadata("beforeQualifiedMap.kt") + public void testQualifiedMap() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/when/beforeQualifiedMap.kt"); + } + + @TestMetadata("beforeUnqualifiedList.kt") + public void testUnqualifiedList() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/when/beforeUnqualifiedList.kt"); + } + + @TestMetadata("beforeUnqualifiedMap.kt") + public void testUnqualifiedMap() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/when/beforeUnqualifiedMap.kt"); + } + + @TestMetadata("beforeUnqualifiedMapOneArg.kt") + public void testUnqualifiedMapOneArg() throws Exception { + doTest("idea/testData/quickfix/addStarProjections/when/beforeUnqualifiedMapOneArg.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("AddStarProjections"); + suite.addTestSuite(AddStarProjections.class); + suite.addTestSuite(JavaClass.class); + suite.addTestSuite(When.class); + return suite; + } + } + + @TestMetadata("idea/testData/quickfix/autoImports") + public static class AutoImports extends AbstractQuickFixTest { + public void testAllFilesPresentInAutoImports() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/autoImports"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeCheckNoStackOverflowInImportInnerClassInCurrentFile.kt") + public void testCheckNoStackOverflowInImportInnerClassInCurrentFile() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeCheckNoStackOverflowInImportInnerClassInCurrentFile.kt"); + } + + @TestMetadata("beforeLibraryTopLevelFunctionImportRuntime.kt") + public void testLibraryTopLevelFunctionImportRuntime() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeLibraryTopLevelFunctionImportRuntime.kt"); + } + + @TestMetadata("beforeNamelessClass.kt") + public void testNamelessClass() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeNamelessClass.kt"); + } + + @TestMetadata("beforeNamelessFunction.kt") + public void testNamelessFunction() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeNamelessFunction.kt"); + } + + @TestMetadata("beforeNamelessObject.kt") + public void testNamelessObject() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeNamelessObject.kt"); + } + + @TestMetadata("beforeNamelessParameter.kt") + public void testNamelessParameter() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeNamelessParameter.kt"); + } + + @TestMetadata("beforeNamelessProperty.kt") + public void testNamelessProperty() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeNamelessProperty.kt"); + } + + @TestMetadata("beforeNoImportForAlreadyImported.kt") + public void testNoImportForAlreadyImported() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeNoImportForAlreadyImported.kt"); + } + + @TestMetadata("beforeNoImportForIndex.kt") + public void testNoImportForIndex() throws Exception { + doTest("idea/testData/quickfix/autoImports/beforeNoImportForIndex.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/expressions") + public static class Expressions extends AbstractQuickFixTest { + public void testAllFilesPresentInExpressions() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/expressions"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeUnnecessaryNonNullAssertion1.kt") + public void testUnnecessaryNonNullAssertion1() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUnnecessaryNonNullAssertion1.kt"); + } + + @TestMetadata("beforeUnnecessaryNonNullAssertion2.kt") + public void testUnnecessaryNonNullAssertion2() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUnnecessaryNonNullAssertion2.kt"); + } + + @TestMetadata("beforeUnnecessaryNonNullAssertion3.kt") + public void testUnnecessaryNonNullAssertion3() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUnnecessaryNonNullAssertion3.kt"); + } + + @TestMetadata("beforeUnnecessarySafeCall1.kt") + public void testUnnecessarySafeCall1() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUnnecessarySafeCall1.kt"); + } + + @TestMetadata("beforeUnsafeCall1.kt") + public void testUnsafeCall1() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUnsafeCall1.kt"); + } + + @TestMetadata("beforeUnsafeCall2.kt") + public void testUnsafeCall2() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUnsafeCall2.kt"); + } + + @TestMetadata("beforeUnsafeCall3.kt") + public void testUnsafeCall3() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUnsafeCall3.kt"); + } + + @TestMetadata("beforeUselessCast.kt") + public void testUselessCast() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUselessCast.kt"); + } + + @TestMetadata("beforeUselessCastStaticAssertIsFine.kt") + public void testUselessCastStaticAssertIsFine() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUselessCastStaticAssertIsFine.kt"); + } + + @TestMetadata("beforeUselessElvis.kt") + public void testUselessElvis() throws Exception { + doTest("idea/testData/quickfix/expressions/beforeUselessElvis.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/migration") + public static class Migration extends AbstractQuickFixTest { + public void testAllFilesPresentInMigration() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/migration"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeBareSure.kt") + public void testBareSure() throws Exception { + doTest("idea/testData/quickfix/migration/beforeBareSure.kt"); + } + + @TestMetadata("beforeSure.kt") + public void testSure() throws Exception { + doTest("idea/testData/quickfix/migration/beforeSure.kt"); + } + + @TestMetadata("beforeTuplesWithRuntime.kt") + public void testTuplesWithRuntime() throws Exception { + doTest("idea/testData/quickfix/migration/beforeTuplesWithRuntime.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/modifiers") + @InnerTestClasses({Modifiers.FinalSupertype.class}) + public static class Modifiers extends AbstractQuickFixTest { + @TestMetadata("beforeAddInnerModifier.kt") + public void testAddInnerModifier() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeAddInnerModifier.kt"); + } + + public void testAllFilesPresentInModifiers() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/modifiers"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeFinalTrait.kt") + public void testFinalTrait() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeFinalTrait.kt"); + } + + @TestMetadata("beforeOpenMemberInFinalClass1.kt") + public void testOpenMemberInFinalClass1() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeOpenMemberInFinalClass1.kt"); + } + + @TestMetadata("beforeOpenMemberInFinalClass2.kt") + public void testOpenMemberInFinalClass2() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeOpenMemberInFinalClass2.kt"); + } + + @TestMetadata("beforeRemoveRedundantModifier1.kt") + public void testRemoveRedundantModifier1() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeRemoveRedundantModifier1.kt"); + } + + @TestMetadata("beforeRemoveRedundantModifier2.kt") + public void testRemoveRedundantModifier2() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeRemoveRedundantModifier2.kt"); + } + + @TestMetadata("beforeRemoveRedundantModifier3.kt") + public void testRemoveRedundantModifier3() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeRemoveRedundantModifier3.kt"); + } + + @TestMetadata("beforeVisibilityModifer1.kt") + public void testVisibilityModifer1() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeVisibilityModifer1.kt"); + } + + @TestMetadata("beforeVisibilityModifer2.kt") + public void testVisibilityModifer2() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeVisibilityModifer2.kt"); + } + + @TestMetadata("beforeVisibilityModiferParameter.kt") + public void testVisibilityModiferParameter() throws Exception { + doTest("idea/testData/quickfix/modifiers/beforeVisibilityModiferParameter.kt"); + } + + @TestMetadata("idea/testData/quickfix/modifiers/finalSupertype") + @InnerTestClasses({FinalSupertype.FinalJavaSupertype.class}) + public static class FinalSupertype extends AbstractQuickFixTest { + public void testAllFilesPresentInFinalSupertype() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/modifiers/finalSupertype"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeEnumSupertype.kt") + public void testEnumSupertype() throws Exception { + doTest("idea/testData/quickfix/modifiers/finalSupertype/beforeEnumSupertype.kt"); + } + + @TestMetadata("beforeExplicitlyFinalSupertype.kt") + public void testExplicitlyFinalSupertype() throws Exception { + doTest("idea/testData/quickfix/modifiers/finalSupertype/beforeExplicitlyFinalSupertype.kt"); + } + + @TestMetadata("beforeFinalLibrarySupertype.kt") + public void testFinalLibrarySupertype() throws Exception { + doTest("idea/testData/quickfix/modifiers/finalSupertype/beforeFinalLibrarySupertype.kt"); + } + + @TestMetadata("beforeFinalSupertype.kt") + public void testFinalSupertype() throws Exception { + doTest("idea/testData/quickfix/modifiers/finalSupertype/beforeFinalSupertype.kt"); + } + + @TestMetadata("beforeImplementTraitFinalSupertype.kt") + public void testImplementTraitFinalSupertype() throws Exception { + doTest("idea/testData/quickfix/modifiers/finalSupertype/beforeImplementTraitFinalSupertype.kt"); + } + + @TestMetadata("idea/testData/quickfix/modifiers/finalSupertype/finalJavaSupertype") + @InnerTestClasses({FinalJavaSupertype.JavaCode.class, }) + public static class FinalJavaSupertype extends AbstractQuickFixTest { + public void testAllFilesPresentInFinalJavaSupertype() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/modifiers/finalSupertype/finalJavaSupertype"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/quickfix/modifiers/finalSupertype/finalJavaSupertype/javaCode") + @InnerTestClasses({}) + public static class JavaCode extends AbstractQuickFixTest { + public void testAllFilesPresentInJavaCode() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/modifiers/finalSupertype/finalJavaSupertype/javaCode"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("JavaCode"); + suite.addTestSuite(JavaCode.class); + return suite; + } + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("FinalJavaSupertype"); + suite.addTestSuite(FinalJavaSupertype.class); + suite.addTest(JavaCode.innerSuite()); + return suite; + } + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("FinalSupertype"); + suite.addTestSuite(FinalSupertype.class); + suite.addTest(FinalJavaSupertype.innerSuite()); + return suite; + } + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Modifiers"); + suite.addTestSuite(Modifiers.class); + suite.addTest(FinalSupertype.innerSuite()); + return suite; + } + } + + @TestMetadata("idea/testData/quickfix/nullables") + public static class Nullables extends AbstractQuickFixTest { + public void testAllFilesPresentInNullables() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/nullables"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeRemoveRedundantNullable.kt") + public void testRemoveRedundantNullable() throws Exception { + doTest("idea/testData/quickfix/nullables/beforeRemoveRedundantNullable.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/override") + public static class Override extends AbstractQuickFixTest { + public void testAllFilesPresentInOverride() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/override"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeChangeToInvocation.kt") + public void testChangeToInvocation() throws Exception { + doTest("idea/testData/quickfix/override/beforeChangeToInvocation.kt"); + } + + @TestMetadata("beforeNothingToOverride.kt") + public void testNothingToOverride() throws Exception { + doTest("idea/testData/quickfix/override/beforeNothingToOverride.kt"); + } + + @TestMetadata("beforeParameterNameChangedAmbiguousRename.kt") + public void testParameterNameChangedAmbiguousRename() throws Exception { + doTest("idea/testData/quickfix/override/beforeParameterNameChangedAmbiguousRename.kt"); + } + + @TestMetadata("beforeParameterNameChangedMultipleOverrideRenamePossible.kt") + public void testParameterNameChangedMultipleOverrideRenamePossible() throws Exception { + doTest("idea/testData/quickfix/override/beforeParameterNameChangedMultipleOverrideRenamePossible.kt"); + } + + @TestMetadata("beforeParameterNameChangedRenamePossible.kt") + public void testParameterNameChangedRenamePossible() throws Exception { + doTest("idea/testData/quickfix/override/beforeParameterNameChangedRenamePossible.kt"); + } + + @TestMetadata("beforeVirtualMethodHidden.kt") + public void testVirtualMethodHidden() throws Exception { + doTest("idea/testData/quickfix/override/beforeVirtualMethodHidden.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/typeAddition") + public static class TypeAddition extends AbstractQuickFixTest { + public void testAllFilesPresentInTypeAddition() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/typeAddition"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeNoAddErrorType.kt") + public void testNoAddErrorType() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforeNoAddErrorType.kt"); + } + + @TestMetadata("beforeProtectedFunWithoutReturnType.kt") + public void testProtectedFunWithoutReturnType() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforeProtectedFunWithoutReturnType.kt"); + } + + @TestMetadata("beforePublicFunWithoutBody.kt") + public void testPublicFunWithoutBody() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforePublicFunWithoutBody.kt"); + } + + @TestMetadata("beforePublicFunWithoutReturnType.kt") + public void testPublicFunWithoutReturnType() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforePublicFunWithoutReturnType.kt"); + } + + @TestMetadata("beforePublicFunWithoutReturnTypeCaretOnParameter.kt") + public void testPublicFunWithoutReturnTypeCaretOnParameter() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforePublicFunWithoutReturnTypeCaretOnParameter.kt"); + } + + @TestMetadata("beforePublicValWithoutReturnType.kt") + public void testPublicValWithoutReturnType() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforePublicValWithoutReturnType.kt"); + } + + @TestMetadata("beforePublicValWithoutReturnTypeCaretOnPublic.kt") + public void testPublicValWithoutReturnTypeCaretOnPublic() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforePublicValWithoutReturnTypeCaretOnPublic.kt"); + } + + @TestMetadata("beforeWrongGetterParameterType.kt") + public void testWrongGetterParameterType() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforeWrongGetterParameterType.kt"); + } + + @TestMetadata("beforeWrongSetterParameterType.kt") + public void testWrongSetterParameterType() throws Exception { + doTest("idea/testData/quickfix/typeAddition/beforeWrongSetterParameterType.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/typeImports") + public static class TypeImports extends AbstractQuickFixTest { + public void testAllFilesPresentInTypeImports() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/typeImports"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeHasThisImport.kt") + public void testHasThisImport() throws Exception { + doTest("idea/testData/quickfix/typeImports/beforeHasThisImport.kt"); + } + + @TestMetadata("beforeNoImportFromTheSameFile.kt") + public void testNoImportFromTheSameFile() throws Exception { + doTest("idea/testData/quickfix/typeImports/beforeNoImportFromTheSameFile.kt"); + } + + @TestMetadata("beforeNoImportJavaLang.kt") + public void testNoImportJavaLang() throws Exception { + doTest("idea/testData/quickfix/typeImports/beforeNoImportJavaLang.kt"); + } + + @TestMetadata("beforeNoImportJetStandard.kt") + public void testNoImportJetStandard() throws Exception { + doTest("idea/testData/quickfix/typeImports/beforeNoImportJetStandard.kt"); + } + + @TestMetadata("beforeToImport1.kt") + public void testToImport1() throws Exception { + doTest("idea/testData/quickfix/typeImports/beforeToImport1.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/typeProjection") + public static class TypeProjection extends AbstractQuickFixTest { + public void testAllFilesPresentInTypeProjection() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/typeProjection"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeRemoveRedundantProjection1.kt") + public void testRemoveRedundantProjection1() throws Exception { + doTest("idea/testData/quickfix/typeProjection/beforeRemoveRedundantProjection1.kt"); + } + + @TestMetadata("beforeRemoveRedundantProjection2.kt") + public void testRemoveRedundantProjection2() throws Exception { + doTest("idea/testData/quickfix/typeProjection/beforeRemoveRedundantProjection2.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/uselessImports") + public static class UselessImports extends AbstractQuickFixTest { + public void testAllFilesPresentInUselessImports() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/uselessImports"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeRemoveUselessImport.kt") + public void testRemoveUselessImport() throws Exception { + doTest("idea/testData/quickfix/uselessImports/beforeRemoveUselessImport.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/variables") + @InnerTestClasses({Variables.ChangeMutability.class, Variables.ChangeToBackingField.class, Variables.ChangeToFunctionInvocation.class}) + public static class Variables extends AbstractQuickFixTest { + public void testAllFilesPresentInVariables() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/variables"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("idea/testData/quickfix/variables/changeMutability") + public static class ChangeMutability extends AbstractQuickFixTest { + public void testAllFilesPresentInChangeMutability() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/variables/changeMutability"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeValReassignmentLocal.kt") + public void testValReassignmentLocal() throws Exception { + doTest("idea/testData/quickfix/variables/changeMutability/beforeValReassignmentLocal.kt"); + } + + @TestMetadata("beforeValReassignmentOuterDecl.kt") + public void testValReassignmentOuterDecl() throws Exception { + doTest("idea/testData/quickfix/variables/changeMutability/beforeValReassignmentOuterDecl.kt"); + } + + @TestMetadata("beforeValReassignmentProperty.kt") + public void testValReassignmentProperty() throws Exception { + doTest("idea/testData/quickfix/variables/changeMutability/beforeValReassignmentProperty.kt"); + } + + @TestMetadata("beforeValWithSetter.kt") + public void testValWithSetter() throws Exception { + doTest("idea/testData/quickfix/variables/changeMutability/beforeValWithSetter.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/variables/changeToBackingField") + public static class ChangeToBackingField extends AbstractQuickFixTest { + public void testAllFilesPresentInChangeToBackingField() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/variables/changeToBackingField"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeBFRequired.kt") + public void testBFRequired() throws Exception { + doTest("idea/testData/quickfix/variables/changeToBackingField/beforeBFRequired.kt"); + } + + @TestMetadata("beforeKt510.kt") + public void testKt510() throws Exception { + doTest("idea/testData/quickfix/variables/changeToBackingField/beforeKt510.kt"); + } + + } + + @TestMetadata("idea/testData/quickfix/variables/changeToFunctionInvocation") + public static class ChangeToFunctionInvocation extends AbstractQuickFixTest { + public void testAllFilesPresentInChangeToFunctionInvocation() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/variables/changeToFunctionInvocation"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeFunInvWithoutParentheses.kt") + public void testFunInvWithoutParentheses() throws Exception { + doTest("idea/testData/quickfix/variables/changeToFunctionInvocation/beforeFunInvWithoutParentheses.kt"); + } + + } + + public static Test innerSuite() { + TestSuite suite = new TestSuite("Variables"); + suite.addTestSuite(Variables.class); + suite.addTestSuite(ChangeMutability.class); + suite.addTestSuite(ChangeToBackingField.class); + suite.addTestSuite(ChangeToFunctionInvocation.class); + return suite; + } + } + + @TestMetadata("idea/testData/quickfix/when") + public static class When extends AbstractQuickFixTest { + public void testAllFilesPresentInWhen() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.GenerateTests", new File("idea/testData/quickfix/when"), Pattern.compile("^before(\\w+)\\.kt$"), true); + } + + @TestMetadata("beforeElseNotLastInWhen.kt") + public void testElseNotLastInWhen() throws Exception { + doTest("idea/testData/quickfix/when/beforeElseNotLastInWhen.kt"); + } + + @TestMetadata("beforeNoElseInWhenWithBranches.kt") + public void testNoElseInWhenWithBranches() throws Exception { + doTest("idea/testData/quickfix/when/beforeNoElseInWhenWithBranches.kt"); + } + + @TestMetadata("beforeNoElseInWhenWithoutBranches.kt") + public void testNoElseInWhenWithoutBranches() throws Exception { + doTest("idea/testData/quickfix/when/beforeNoElseInWhenWithoutBranches.kt"); + } + + @TestMetadata("beforeTwoElseBranchesInWhen.kt") + public void testTwoElseBranchesInWhen() throws Exception { + doTest("idea/testData/quickfix/when/beforeTwoElseBranchesInWhen.kt"); + } + + } + + public static Test suite() { + TestSuite suite = new TestSuite("QuickFixTestGenerated"); + suite.addTestSuite(QuickFixTestGenerated.class); + suite.addTestSuite(Abstract.class); + suite.addTest(AddStarProjections.innerSuite()); + suite.addTestSuite(AutoImports.class); + suite.addTestSuite(Expressions.class); + suite.addTestSuite(Migration.class); + suite.addTest(Modifiers.innerSuite()); + suite.addTestSuite(Nullables.class); + suite.addTestSuite(Override.class); + suite.addTestSuite(TypeAddition.class); + suite.addTestSuite(TypeImports.class); + suite.addTestSuite(TypeProjection.class); + suite.addTestSuite(UselessImports.class); + suite.addTest(Variables.innerSuite()); + suite.addTestSuite(When.class); + return suite; + } +}