mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-80097 "Redundant suppression" inspection ability to ignore "ALL"
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.intellij.codeInspection;
|
||||
|
||||
import com.intellij.codeInspection.ex.GlobalInspectionToolWrapper;
|
||||
import com.intellij.codeInspection.ex.InspectionProfileImpl;
|
||||
import com.intellij.codeInspection.ex.InspectionToolRegistrar;
|
||||
import com.intellij.testFramework.InspectionTestCase;
|
||||
|
||||
public class RedundantSuppressTest extends InspectionTestCase {
|
||||
private GlobalInspectionToolWrapper myWrapper;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
super.setUp();
|
||||
InspectionToolRegistrar.getInstance().ensureInitialized();
|
||||
myWrapper = new GlobalInspectionToolWrapper(new RedundantSuppressInspection());
|
||||
}
|
||||
|
||||
public void testDefaultFile() throws Exception {
|
||||
InspectionProfileImpl.INIT_INSPECTIONS = true;
|
||||
doTest();
|
||||
InspectionProfileImpl.INIT_INSPECTIONS = false;
|
||||
}
|
||||
|
||||
public void testSuppressAll() throws Exception {
|
||||
InspectionProfileImpl.INIT_INSPECTIONS = true;
|
||||
try {
|
||||
((RedundantSuppressInspection)myWrapper.getTool()).IGNORE_ALL = true;
|
||||
doTest();
|
||||
}
|
||||
finally {
|
||||
((RedundantSuppressInspection)myWrapper.getTool()).IGNORE_ALL = false;
|
||||
InspectionProfileImpl.INIT_INSPECTIONS = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest("redundantSuppress/" + getTestName(true), myWrapper,"java 1.5",true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user