mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
- extract tests, which require old annotations - return old name to method to add annotations GitOrigin-RevId: c559cea10f942f72d5a19176d3ee808d46ad5dd2
63 lines
2.2 KiB
Java
63 lines
2.2 KiB
Java
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
|
package com.siyeh.ig.fixes.dataflow;
|
|
|
|
import com.intellij.codeInspection.dataFlow.DataFlowInspection;
|
|
import com.intellij.openapi.roots.ModuleRootModificationUtil;
|
|
import com.intellij.pom.java.LanguageLevel;
|
|
import com.intellij.testFramework.builders.JavaModuleFixtureBuilder;
|
|
import com.intellij.testFramework.fixtures.DefaultLightProjectDescriptor;
|
|
import com.siyeh.InspectionGadgetsBundle;
|
|
import com.siyeh.ig.IGQuickFixesTestCase;
|
|
|
|
public class CreateNullBranchFixTest extends IGQuickFixesTestCase {
|
|
|
|
@Override
|
|
protected void setUp() throws Exception {
|
|
super.setUp();
|
|
myFixture.enableInspections(new DataFlowInspection());
|
|
myRelativePath = "dataflow/create_null_branch";
|
|
ModuleRootModificationUtil.updateModel(getModule(), DefaultLightProjectDescriptor::addJetBrainsAnnotationsWithTypeUse);
|
|
}
|
|
|
|
@Override
|
|
protected void tuneFixture(JavaModuleFixtureBuilder builder) throws Exception {
|
|
builder.setLanguageLevel(LanguageLevel.JDK_21);
|
|
}
|
|
|
|
public void testNoDefault() {
|
|
doTest(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
|
|
public void testDefaultExists() {
|
|
doTest(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
|
|
public void testPrevStatementCompletesNormally() {
|
|
doTest(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
|
|
public void testRuleWithNoDefault() {
|
|
doTest(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
|
|
public void testRuleWithDefaultExists() {
|
|
doTest(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
|
|
public void testNullAlreadyExists() {
|
|
assertQuickfixNotAvailable(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
|
|
public void testUnconditionalPatternExists() {
|
|
doTest(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
|
|
public void testUnconditionalPatternNotExist() {
|
|
doTest(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
|
|
public void testEmptyBody() {
|
|
doTest(InspectionGadgetsBundle.message("create.null.branch.fix.family.name"));
|
|
}
|
|
}
|