test "Fix all 'Unnecessary fully qualified name' problems in file"

This commit is contained in:
Bas Leijdekkers
2017-04-27 19:21:50 +02:00
parent bea8cec709
commit af0239a648
3 changed files with 27 additions and 2 deletions
@@ -0,0 +1,9 @@
import java.util.Date;
// "Fix all 'Unnecessary fully qualified name' problems in file" "true"
class FullyQualifiedName {
void m(Object value) {
value = new java.sql.Date(((Date) value).getTime());
}
}
@@ -0,0 +1,7 @@
// "Fix all 'Unnecessary fully qualified name' problems in file" "true"
class FullyQualifiedName {
void m(Object value) {
value = new java.sql.Date(((java.<caret>util.Date) value).getTime());
}
}
@@ -7,8 +7,10 @@ package com.intellij.codeInsight.daemon.quickFix;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.dataFlow.DataFlowInspection;
import com.intellij.codeInspection.ex.GlobalInspectionToolWrapper;
import com.intellij.codeInspection.ex.InspectionToolWrapper;
import com.intellij.codeInspection.visibility.VisibilityInspection;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.testFramework.IdeaTestUtil;
import com.siyeh.ig.style.UnnecessaryFullyQualifiedNameInspection;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
@@ -17,7 +19,8 @@ public class FixAllQuickfixTest extends LightQuickFixParameterizedTestCase {
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
return new LocalInspectionTool[] {
new DataFlowInspection()
new DataFlowInspection(),
new UnnecessaryFullyQualifiedNameInspection()
};
}
@@ -34,4 +37,10 @@ public class FixAllQuickfixTest extends LightQuickFixParameterizedTestCase {
protected String getBasePath() {
return "/codeInsight/daemonCodeAnalyzer/quickFix/fixAll";
}
@Override
protected Sdk getProjectJDK() {
// jdk 1.7 needed because it contains java.sql.Date for FullyQualifiedName test
return IdeaTestUtil.getMockJdk17();
}
}