mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Convenient method for register inspections in tests
This commit is contained in:
+3
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2010 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -99,6 +99,8 @@ public interface CodeInsightTestFixture extends IdeaProjectTestFixture {
|
||||
|
||||
void enableInspections(Class<? extends LocalInspectionTool>... inspections);
|
||||
|
||||
void enableInspections(@NotNull Collection<Class<? extends LocalInspectionTool>> inspections);
|
||||
|
||||
void disableInspections(InspectionProfileEntry... inspections);
|
||||
|
||||
/**
|
||||
|
||||
+8
-3
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2011 JetBrains s.r.o.
|
||||
* Copyright 2000-2012 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.
|
||||
@@ -252,10 +252,15 @@ public class CodeInsightTestFixtureImpl extends BaseFixture implements CodeInsig
|
||||
|
||||
@Override
|
||||
public void enableInspections(final Class<? extends LocalInspectionTool>... inspections) {
|
||||
enableInspections(Arrays.asList(inspections));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableInspections(@NotNull final Collection<Class<? extends LocalInspectionTool>> inspections) {
|
||||
final ArrayList<LocalInspectionTool> tools = new ArrayList<LocalInspectionTool>();
|
||||
for (Class clazz : inspections) {
|
||||
for (Class<? extends LocalInspectionTool> clazz : inspections) {
|
||||
try {
|
||||
LocalInspectionTool inspection = (LocalInspectionTool)clazz.getConstructor().newInstance();
|
||||
LocalInspectionTool inspection = clazz.getConstructor().newInstance();
|
||||
tools.add(inspection);
|
||||
}
|
||||
catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user