IDEA-189985 - RegistrationProblemsInspection - Split component and actions tests into separate classes

GitOrigin-RevId: c6f012c1caab852add1505a2b412f99647728b43
This commit is contained in:
Karol Lewandowski
2022-11-03 19:38:24 +00:00
committed by intellij-monorepo-bot
parent 8314fe0260
commit 375689d19f
44 changed files with 160 additions and 125 deletions
@@ -0,0 +1,31 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.inspections;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.idea.devkit.DevkitJavaTestsUtil;
@TestDataPath("$CONTENT_ROOT/testData/inspections/registrationProblems/xml/actions")
public class PluginXmlDomInspectionActionHighlightingTest extends PluginXmlDomInspectionTestBase {
@Override
protected String getBasePath() {
return DevkitJavaTestsUtil.TESTDATA_PATH + "inspections/registrationProblems/xml/actions";
}
public void testActionAbstractClass() {
myFixture.testHighlighting("ActionAbstractClass.xml",
"MyAbstractAction.java");
}
public void testActionUnresolvedClass() {
myFixture.testHighlighting("ActionUnresolvedClass.xml");
}
public void testActionWithoutDefaultCtor() {
myFixture.testHighlighting("ActionWithoutDefaultCtor.xml",
"MyActionWithoutDefaultCtor.java");
}
public void testActionWrongClass() {
myFixture.testHighlighting("ActionWrongClass.xml");
}
}
@@ -0,0 +1,48 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.inspections;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.idea.devkit.DevkitJavaTestsUtil;
@TestDataPath("$CONTENT_ROOT/testData/inspections/registrationProblems/xml/components")
public class PluginXmlDomInspectionComponentHighlightingTest extends PluginXmlDomInspectionTestBase {
@Override
protected String getBasePath() {
return DevkitJavaTestsUtil.TESTDATA_PATH + "inspections/registrationProblems/xml/components";
}
public void testComponentAbstractImplementation() {
myFixture.testHighlighting(
"ComponentAbstractImplementation.xml",
"AbstractApplicationComponent.java");
}
public void testComponentMissingImplementation() {
myFixture.testHighlighting(
"ComponentMissingImplementation.xml");
}
public void testComponentUnresolvedClass() {
myFixture.testHighlighting("ComponentUnresolvedClass.xml");
}
public void testComponentClassNotAssignableToInterface() {
myFixture.testHighlighting(
"ComponentClassNotAssignableToInterface.xml",
"ApplicationComponent.java");
}
public void testComponentMultipleWithSameInterface() {
myFixture.addClass("package com.intellij.openapi.module; public interface ModuleComponent {}");
myFixture.testHighlighting(
"ComponentMultipleWithSameInterface.xml",
"ApplicationComponent.java",
"ApplicationComponent2.java",
"ApplicationComponentInterface.java",
"MyModuleComponent.java",
"MyModuleComponent2.java",
"MyModuleComponent3.java",
"MyModuleComponentInterface.java");
}
}
@@ -1,62 +0,0 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.inspections;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.idea.devkit.DevkitJavaTestsUtil;
@TestDataPath("$CONTENT_ROOT/testData/inspections/registrationProblems/xml")
public class PluginXmlDomInspectionTest extends PluginXmlDomInspectionTestBase {
@Override
protected String getBasePath() {
return DevkitJavaTestsUtil.TESTDATA_PATH + "inspections/registrationProblems/xml";
}
public void testComponentAbstractImplementation() {
myFixture.testHighlighting("ComponentAbstractImplementation.xml",
"AbstractApplicationComponent.java");
}
public void testComponentMissingImplementation() {
myFixture.testHighlighting("ComponentMissingImplementation.xml");
}
public void testComponentUnresolvedClass() {
myFixture.testHighlighting("ComponentUnresolvedClass.xml");
}
public void testActionAbstractClass() {
myFixture.testHighlighting("ActionAbstractClass.xml",
"MyAbstractAction.java");
}
public void testActionUnresolvedClass() {
myFixture.testHighlighting("ActionUnresolvedClass.xml");
}
public void testActionWithoutDefaultCtor() {
myFixture.testHighlighting("ActionWithoutDefaultCtor.xml",
"MyActionWithoutDefaultCtor.java");
}
public void testActionWrongClass() {
myFixture.testHighlighting("ActionWrongClass.xml");
}
public void testComponentClassNotAssignableToInterface() {
myFixture.testHighlighting("ComponentClassNotAssignableToInterface.xml",
"ApplicationComponent.java");
}
public void testComponentMultipleWithSameInterface() {
myFixture.addClass("package com.intellij.openapi.module; public interface ModuleComponent {}");
myFixture.testHighlighting("ComponentMultipleWithSameInterface.xml",
"ApplicationComponent.java",
"ApplicationComponent2.java",
"ApplicationComponentInterface.java",
"MyModuleComponent.java",
"MyModuleComponent2.java",
"MyModuleComponent3.java",
"MyModuleComponentInterface.java");
}
}
@@ -0,0 +1,32 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.kotlin.inspections;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.idea.devkit.inspections.PluginXmlDomInspectionTestBase;
import org.jetbrains.idea.devkit.kotlin.DevkitKtTestsUtil;
@TestDataPath("$CONTENT_ROOT/testData/inspections/registrationProblems/xml/actions")
public class KtPluginXmlDomInspectionActionHighlightingTest extends PluginXmlDomInspectionTestBase {
@Override
protected String getBasePath() {
return DevkitKtTestsUtil.TESTDATA_PATH + "inspections/registrationProblems/xml/actions";
}
public void testActionAbstractClass() {
myFixture.testHighlighting("ActionAbstractClass.xml",
"MyAbstractAction.kt");
}
public void testActionUnresolvedClass() {
myFixture.testHighlighting("ActionUnresolvedClass.xml");
}
public void testActionWithoutDefaultCtor() {
myFixture.testHighlighting("ActionWithoutDefaultCtor.xml",
"MyActionWithoutDefaultCtor.kt");
}
public void testActionWrongClass() {
myFixture.testHighlighting("ActionWrongClass.xml");
}
}
@@ -0,0 +1,49 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.kotlin.inspections;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.idea.devkit.inspections.PluginXmlDomInspectionTestBase;
import org.jetbrains.idea.devkit.kotlin.DevkitKtTestsUtil;
@TestDataPath("$CONTENT_ROOT/testData/inspections/registrationProblems/xml/components")
public class KtPluginXmlDomInspectionComponentHighlightingTest extends PluginXmlDomInspectionTestBase {
@Override
protected String getBasePath() {
return DevkitKtTestsUtil.TESTDATA_PATH + "inspections/registrationProblems/xml/components";
}
public void testComponentAbstractImplementation() {
myFixture.testHighlighting(
"ComponentAbstractImplementation.xml",
"AbstractApplicationComponent.kt");
}
public void testComponentMissingImplementation() {
myFixture.testHighlighting(
"ComponentMissingImplementation.xml");
}
public void testComponentUnresolvedClass() {
myFixture.testHighlighting("ComponentUnresolvedClass.xml");
}
public void testComponentClassNotAssignableToInterface() {
myFixture.testHighlighting(
"ComponentClassNotAssignableToInterface.xml",
"ApplicationComponent.kt");
}
public void testComponentMultipleWithSameInterface() {
myFixture.addClass("package com.intellij.openapi.module; public interface ModuleComponent {}");
myFixture.testHighlighting(
"ComponentMultipleWithSameInterface.xml",
"ApplicationComponent.kt",
"ApplicationComponent2.kt",
"ApplicationComponentInterface.kt",
"MyModuleComponent.kt",
"MyModuleComponent2.kt",
"MyModuleComponent3.kt",
"MyModuleComponentInterface.kt");
}
}
@@ -1,63 +0,0 @@
// Copyright 2000-2022 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.idea.devkit.kotlin.inspections;
import com.intellij.testFramework.TestDataPath;
import org.jetbrains.idea.devkit.inspections.PluginXmlDomInspectionTestBase;
import org.jetbrains.idea.devkit.kotlin.DevkitKtTestsUtil;
@TestDataPath("$CONTENT_ROOT/testData/inspections/registrationProblems/xml")
public class KtPluginXmlDomInspectionTest extends PluginXmlDomInspectionTestBase {
@Override
protected String getBasePath() {
return DevkitKtTestsUtil.TESTDATA_PATH + "inspections/registrationProblems/xml";
}
public void testComponentAbstractImplementation() {
myFixture.testHighlighting("ComponentAbstractImplementation.xml",
"AbstractApplicationComponent.kt");
}
public void testComponentMissingImplementation() {
myFixture.testHighlighting("ComponentMissingImplementation.xml");
}
public void testComponentUnresolvedClass() {
myFixture.testHighlighting("ComponentUnresolvedClass.xml");
}
public void testActionAbstractClass() {
myFixture.testHighlighting("ActionAbstractClass.xml",
"MyAbstractAction.kt");
}
public void testActionUnresolvedClass() {
myFixture.testHighlighting("ActionUnresolvedClass.xml");
}
public void testActionWithoutDefaultCtor() {
myFixture.testHighlighting("ActionWithoutDefaultCtor.xml",
"MyActionWithoutDefaultCtor.kt");
}
public void testActionWrongClass() {
myFixture.testHighlighting("ActionWrongClass.xml");
}
public void testComponentClassNotAssignableToInterface() {
myFixture.testHighlighting("ComponentClassNotAssignableToInterface.xml",
"ApplicationComponent.kt");
}
public void testComponentMultipleWithSameInterface() {
myFixture.addClass("package com.intellij.openapi.module; public interface ModuleComponent {}");
myFixture.testHighlighting("ComponentMultipleWithSameInterface.xml",
"ApplicationComponent.kt",
"ApplicationComponent2.kt",
"ApplicationComponentInterface.kt",
"MyModuleComponent.kt",
"MyModuleComponent2.kt",
"MyModuleComponent3.kt",
"MyModuleComponentInterface.kt");
}
}