From fef758264d3070a6a720b21e6fe4a9d275eb515f Mon Sep 17 00:00:00 2001 From: Anna Kozlova Date: Wed, 22 Jun 2016 14:06:32 +0300 Subject: [PATCH] test discovery: remove discovery type if not enabled in registry (IDEA-157764) --- .../testng/configuration/TestNGConfigurationEditor.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java index 2466d11f3689..de10fb9c7192 100644 --- a/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java +++ b/plugins/testng/src/com/theoryinpractice/testng/configuration/TestNGConfigurationEditor.java @@ -159,9 +159,11 @@ public class TestNGConfigurationEditor extends Se }); panel.add(editBtn, BorderLayout.EAST); - final CollectionComboBoxModel testKindModel = new CollectionComboBoxModel<>(Arrays.asList(TestType.values())); - if (!Registry.is("testDiscovery.enabled")) { - testKindModel.remove(TestType.SOURCE); + final CollectionComboBoxModel testKindModel = new CollectionComboBoxModel<>(); + for (TestType type : TestType.values()) { + if (type != TestType.SOURCE || Registry.is("testDiscovery.enabled")) { + testKindModel.add(type); + } } myTestKind.setModel(testKindModel); myTestKind.addActionListener(new ActionListener() {