diff --git a/java/java-impl/src/com/intellij/testIntegration/createTest/CreateTestDialog.java b/java/java-impl/src/com/intellij/testIntegration/createTest/CreateTestDialog.java index 368d5bbadb51..fe2b896499b3 100644 --- a/java/java-impl/src/com/intellij/testIntegration/createTest/CreateTestDialog.java +++ b/java/java-impl/src/com/intellij/testIntegration/createTest/CreateTestDialog.java @@ -232,9 +232,16 @@ public class CreateTestDialog extends DialogWrapper { } private void onLibrarySelected(TestFramework descriptor) { - String text = CodeInsightBundle.message("intention.create.test.dialog.library.not.found", descriptor.getName()); - myFixLibraryLabel.setText(text); - myFixLibraryPanel.setVisible(!descriptor.isLibraryAttached(myTargetModule)); + if (descriptor.isLibraryAttached(myTargetModule)) { + myFixLibraryPanel.setVisible(false); + } + else { + myFixLibraryPanel.setVisible(true); + String text = CodeInsightBundle.message("intention.create.test.dialog.library.not.found", descriptor.getName()); + myFixLibraryLabel.setText(text); + + myFixLibraryButton.setVisible(descriptor.getLibraryPath() != null); + } String superClass = descriptor.getDefaultSuperClass(); diff --git a/platform/core-api/src/com/intellij/testIntegration/TestFramework.java b/platform/core-api/src/com/intellij/testIntegration/TestFramework.java index ee6b5e3f7d4a..be6965020587 100644 --- a/platform/core-api/src/com/intellij/testIntegration/TestFramework.java +++ b/platform/core-api/src/com/intellij/testIntegration/TestFramework.java @@ -38,7 +38,7 @@ public interface TestFramework { boolean isLibraryAttached(@NotNull Module module); - @NotNull + @Nullable String getLibraryPath(); @Nullable diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/spock/SpockTestFramework.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/spock/SpockTestFramework.java index 31caa83a0e55..ec5353495515 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/spock/SpockTestFramework.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/spock/SpockTestFramework.java @@ -37,15 +37,9 @@ public class SpockTestFramework extends GroovyTestFramework { return "Spock"; } - @NotNull @Override public String getLibraryPath() { - try { - return PathUtil.getJarPathForClass(Class.forName(getMarkerClassFQName())); - } - catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } + return null; } @Nullable diff --git a/plugins/groovy/src/org/jetbrains/plugins/groovy/testIntegration/GroovyTestFramework.java b/plugins/groovy/src/org/jetbrains/plugins/groovy/testIntegration/GroovyTestFramework.java index 328f44b0309b..94513d6b03f3 100644 --- a/plugins/groovy/src/org/jetbrains/plugins/groovy/testIntegration/GroovyTestFramework.java +++ b/plugins/groovy/src/org/jetbrains/plugins/groovy/testIntegration/GroovyTestFramework.java @@ -122,7 +122,6 @@ public class GroovyTestFramework extends JavaTestFramework { return JetgroovyIcons.Groovy.Groovy_16x16; } - @NotNull @Override public String getLibraryPath() { return GroovyUtils.getBundledGroovyJar().getAbsolutePath();