mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-115660 Fix Spock library in Create test dialog does not work
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ public interface TestFramework {
|
||||
|
||||
boolean isLibraryAttached(@NotNull Module module);
|
||||
|
||||
@NotNull
|
||||
@Nullable
|
||||
String getLibraryPath();
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -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
|
||||
|
||||
-1
@@ -122,7 +122,6 @@ public class GroovyTestFramework extends JavaTestFramework {
|
||||
return JetgroovyIcons.Groovy.Groovy_16x16;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getLibraryPath() {
|
||||
return GroovyUtils.getBundledGroovyJar().getAbsolutePath();
|
||||
|
||||
Reference in New Issue
Block a user