make IG test light

This commit is contained in:
Bas Leijdekkers
2015-11-05 21:43:55 +01:00
parent d4d8fa7a71
commit ee80a1da3a
6 changed files with 25 additions and 24 deletions
@@ -8,4 +8,4 @@ public class EmptyClass {
}
class MyList extends java.util.ArrayList<String> {}
class MyException extends java.lang.Exception {}
abstract class ReportMe implements java.util.List {}
abstract class <warning descr="Class 'ReportMe' is empty">ReportMe</warning> implements java.util.List {}
@@ -0,0 +1 @@
<warning descr="Java file does not declare any class">// comment</warning>
@@ -1,16 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>EmptyClass.java</file>
<line>11</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Empty class</problem_class>
<description>Class &lt;code&gt;ReportMe&lt;/code&gt; is empty #loc</description>
</problem>
<problem>
<file>EmptyFile.java</file>
<line>1</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Empty class</problem_class>
<description>Java file does not declare any class #loc</description>
</problem>
</problems>
@@ -1,13 +1,29 @@
package com.siyeh.ig.classlayout;
import com.siyeh.ig.IGInspectionTestCase;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;
public class EmptyClassInspectionTest extends IGInspectionTestCase {
public class EmptyClassInspectionTest extends LightInspectionTestCase {
public void test() throws Exception {
final EmptyClassInspection tool = new EmptyClassInspection();
tool.ignoreClassWithParameterization = true;
tool.ignoreThrowables = true;
doTest("com/siyeh/igtest/classlayout/emptyclass", tool);
public void testEmptyClass() {
doTest();
}
public void testPackageInfo() {
doNamedTest("package-info");
}
public void testEmptyFile() {
doTest();
}
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
final EmptyClassInspection inspection = new EmptyClassInspection();
inspection.ignoreClassWithParameterization = true;
inspection.ignoreThrowables = true;
return inspection;
}
}