make IG test light

This commit is contained in:
Bas Leijdekkers
2016-07-11 19:59:53 +02:00
parent 76c8aa3268
commit 13e7a48b00
3 changed files with 14 additions and 26 deletions
@@ -14,7 +14,7 @@ public class ThrowableInstanceNeverThrown {
}
void bar() {
new RuntimeException();
<warning descr="Runtime exception instance 'new RuntimeException()' is not thrown">new RuntimeException()</warning>;
}
void throwing() throws Throwable {
@@ -31,7 +31,7 @@ public class ThrowableInstanceNeverThrown {
}
void leftBehind() throws Throwable {
final RuntimeException e = new RuntimeException("throw me");
final RuntimeException e = <warning descr="Runtime exception instance 'new RuntimeException(\"throw me\")' is not thrown">new RuntimeException("throw me")</warning>;
}
void exceptionIsCollected() {
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>ThrowableInstanceNeverThrown.java</file>
<line>17</line>
<problem_class>Throwable instance not thrown</problem_class>
<description>Runtime exception instance &lt;code&gt;new RuntimeException()&lt;/code&gt; is not thrown</description>
</problem>
<problem>
<file>ThrowableInstanceNeverThrown.java</file>
<line>34</line>
<problem_class>Throwable instance not thrown</problem_class>
<description>Runtime exception instance &lt;code&gt;new RuntimeException(&quot;throw me&quot;)&lt;/code&gt; is not thrown</description>
</problem>
</problems>
@@ -1,12 +1,18 @@
package com.siyeh.ig.bugs;
import com.siyeh.ig.IGInspectionTestCase;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;
public class ThrowableInstanceNeverThrownInspectionTest
extends IGInspectionTestCase {
public class ThrowableInstanceNeverThrownInspectionTest extends LightInspectionTestCase {
public void test() throws Exception {
doTest("com/siyeh/igtest/bugs/throwable_instance_never_thrown",
new ThrowableInstanceNeverThrownInspection());
public void testThrowableInstanceNeverThrown() {
doTest();
}
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
return new ThrowableInstanceNeverThrownInspection();
}
}