From 036ef00488310fc12b7bb00ccc7ba85af56c7d29 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Sat, 23 Sep 2017 22:56:24 +0200 Subject: [PATCH] make IG test light --- ...itchStatementWithConfusingDeclaration.java | 2 +- .../expected.xml | 9 ------ ...ithConfusingDeclarationInspectionTest.java | 32 ++++++++++++++++--- 3 files changed, 28 insertions(+), 15 deletions(-) delete mode 100644 plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration/expected.xml diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration/SwitchStatementWithConfusingDeclaration.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration/SwitchStatementWithConfusingDeclaration.java index 7f175281b597..0cce989515b1 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration/SwitchStatementWithConfusingDeclaration.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration/SwitchStatementWithConfusingDeclaration.java @@ -7,7 +7,7 @@ public class SwitchStatementWithConfusingDeclaration switch(3) { case 2: - int x = 0; + int x = 0; break; case 3: x = 3; diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration/expected.xml deleted file mode 100644 index d92c4d5334ce..000000000000 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration/expected.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - SwitchStatementWithConfusingDeclaration.java - 10 - Local variable used and declared in different 'switch' branches - Local variable <code>x</code> declared in one 'switch' branch and used in another #loc - - \ No newline at end of file diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/controlflow/SwitchStatementWithConfusingDeclarationInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/controlflow/SwitchStatementWithConfusingDeclarationInspectionTest.java index a22d96bd2b61..e833865dbe41 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/controlflow/SwitchStatementWithConfusingDeclarationInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/controlflow/SwitchStatementWithConfusingDeclarationInspectionTest.java @@ -1,11 +1,33 @@ +/* + * Copyright 2000-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.siyeh.ig.controlflow; -import com.siyeh.ig.IGInspectionTestCase; +import com.intellij.codeInspection.InspectionProfileEntry; +import com.siyeh.ig.LightInspectionTestCase; +import org.jetbrains.annotations.Nullable; -public class SwitchStatementWithConfusingDeclarationInspectionTest extends IGInspectionTestCase { +public class SwitchStatementWithConfusingDeclarationInspectionTest extends LightInspectionTestCase { - public void test() { - doTest("com/siyeh/igtest/controlflow/switch_statement_with_confusing_declaration", - new SwitchStatementWithConfusingDeclarationInspection()); + public void testSwitchStatementWithConfusingDeclaration() { + doTest(); + } + + @Nullable + @Override + protected InspectionProfileEntry getInspection() { + return new SwitchStatementWithConfusingDeclarationInspection(); } } \ No newline at end of file