From 88753e7fade852a9d72a980c80c878c565ded247 Mon Sep 17 00:00:00 2001 From: Bas Leijdekkers Date: Thu, 23 Nov 2017 15:28:18 +0100 Subject: [PATCH] make IG test light --- .../RawUseOfParameterizedType.java | 10 ++--- .../expected.xml | 45 ------------------- ...wUseOfParameterizedTypeInspectionTest.java | 27 +++++++---- 3 files changed, 23 insertions(+), 59 deletions(-) delete mode 100644 plugins/InspectionGadgets/test/com/siyeh/igtest/migration/raw_use_of_parameterized_type/expected.xml diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/migration/raw_use_of_parameterized_type/RawUseOfParameterizedType.java b/plugins/InspectionGadgets/test/com/siyeh/igtest/migration/raw_use_of_parameterized_type/RawUseOfParameterizedType.java index c44ab197ae75..6ec82a24ac9b 100644 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/migration/raw_use_of_parameterized_type/RawUseOfParameterizedType.java +++ b/plugins/InspectionGadgets/test/com/siyeh/igtest/migration/raw_use_of_parameterized_type/RawUseOfParameterizedType.java @@ -7,16 +7,16 @@ import java.util.concurrent.Callable; @interface Anno { - Class method() default List.class; + Class method() default List.class; Class method2() default List.class; } class RawUseOfParameterizedType { void array() { - final ArrayList[] array = + final ArrayList[] array = new ArrayList[10]; } void anonymous() { - new Callable() { + new Callable() { @Override public Object call() throws Exception { return null; @@ -29,12 +29,12 @@ class RawUseOfParameterizedType { } } interface X { - List foo(Map map); + List foo(Map map); } class Y implements X { @Override - public List foo(Map map) { + public List foo(Map map) { return null; } diff --git a/plugins/InspectionGadgets/test/com/siyeh/igtest/migration/raw_use_of_parameterized_type/expected.xml b/plugins/InspectionGadgets/test/com/siyeh/igtest/migration/raw_use_of_parameterized_type/expected.xml deleted file mode 100644 index 8640dafccfb1..000000000000 --- a/plugins/InspectionGadgets/test/com/siyeh/igtest/migration/raw_use_of_parameterized_type/expected.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - RawUseOfParameterizedType.java - 10 - Raw use of parameterized class - Raw use of parameterized class <code>Class</code> #loc - - - - RawUseOfParameterizedType.java - 15 - Raw use of parameterized class - Raw use of parameterized class <code>ArrayList</code> #loc - - - - RawUseOfParameterizedType.java - 19 - Raw use of parameterized class - Raw use of parameterized class <code>Callable</code> #loc - - - - RawUseOfParameterizedType.java - 32 - Raw use of parameterized class - Raw use of parameterized class <code>List</code> #loc - - - - RawUseOfParameterizedType.java - 32 - Raw use of parameterized class - Raw use of parameterized class <code>Map</code> #loc - - - - RawUseOfParameterizedType.java - 37 - Raw use of parameterized class - Raw use of parameterized class <code>List</code> #loc - - \ No newline at end of file diff --git a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/migration/RawUseOfParameterizedTypeInspectionTest.java b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/migration/RawUseOfParameterizedTypeInspectionTest.java index 50dfd92f8fbf..83587b341073 100644 --- a/plugins/InspectionGadgets/testsrc/com/siyeh/ig/migration/RawUseOfParameterizedTypeInspectionTest.java +++ b/plugins/InspectionGadgets/testsrc/com/siyeh/ig/migration/RawUseOfParameterizedTypeInspectionTest.java @@ -1,15 +1,24 @@ +// Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.siyeh.ig.migration; -import com.siyeh.ig.IGInspectionTestCase; +import com.intellij.codeInspection.InspectionProfileEntry; +import com.siyeh.ig.LightInspectionTestCase; +import org.jetbrains.annotations.Nullable; -public class RawUseOfParameterizedTypeInspectionTest extends IGInspectionTestCase { +public class RawUseOfParameterizedTypeInspectionTest extends LightInspectionTestCase { - public void test() { - final RawUseOfParameterizedTypeInspection tool = new RawUseOfParameterizedTypeInspection(); - tool.ignoreObjectConstruction = false; - tool.ignoreUncompilable = true; - tool.ignoreParametersOfOverridingMethods = true; - tool.ignoreTypeCasts = true; - doTest("com/siyeh/igtest/migration/raw_use_of_parameterized_type", tool); + public void testRawUseOfParameterizedType() { + doTest(); + } + + @Nullable + @Override + protected InspectionProfileEntry getInspection() { + final RawUseOfParameterizedTypeInspection inspection = new RawUseOfParameterizedTypeInspection(); + inspection.ignoreObjectConstruction = false; + inspection.ignoreUncompilable = true; + inspection.ignoreParametersOfOverridingMethods = true; + inspection.ignoreTypeCasts = true; + return inspection; } } \ No newline at end of file