From 13e7a48b00efbb53e692ad4bfc06fef9c8e19fb0 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Mon, 11 Jul 2016 18:31:34 +0200 Subject: [PATCH] make IG test light --- .../ThrowableInstanceNeverThrown.java | 4 ++-- .../expected.xml | 18 ------------------ ...wableInstanceNeverThrownInspectionTest.java | 18 ++++++++++++------ 3 files changed, 14 insertions(+), 26 deletions(-) delete mode 100644 plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/expected.xml diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/ThrowableInstanceNeverThrown.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/ThrowableInstanceNeverThrown.java index 711776a7d91c..6c49b9f13655 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/ThrowableInstanceNeverThrown.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/ThrowableInstanceNeverThrown.java @@ -14,7 +14,7 @@ public class ThrowableInstanceNeverThrown { } void bar() { - new RuntimeException(); + new RuntimeException(); } 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 = new RuntimeException("throw me"); } void exceptionIsCollected() { diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/expected.xml deleted file mode 100644 index 9dfb5295b08f..000000000000 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/bugs/throwable_instance_never_thrown/expected.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - ThrowableInstanceNeverThrown.java - 17 - Throwable instance not thrown - Runtime exception instance <code>new RuntimeException()</code> is not thrown - - - - ThrowableInstanceNeverThrown.java - 34 - Throwable instance not thrown - Runtime exception instance <code>new RuntimeException("throw me")</code> is not thrown - - - \ No newline at end of file diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspectionTest.java index 16889dd32041..2240a1c13225 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/bugs/ThrowableInstanceNeverThrownInspectionTest.java @@ -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(); } }