From 30042d0305a1658da66bd1cb5224d1ce1c3863b2 Mon Sep 17 00:00:00 2001 From: Sergey Evdokimov Date: Thu, 29 Mar 2012 18:30:41 +0400 Subject: [PATCH 1/5] Add additional loggining to understand cause of maven test fail --- .../maven/dom/MavenExtensionCompletionAndResolutionTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java index 95f5341069c4..211cf736ca95 100644 --- a/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java +++ b/plugins/maven/src/test/java/org/jetbrains/idea/maven/dom/MavenExtensionCompletionAndResolutionTest.java @@ -21,6 +21,8 @@ import com.intellij.psi.PsiReference; import org.jetbrains.idea.maven.indices.MavenIndicesTestFixture; import org.jetbrains.idea.maven.indices.MavenProjectIndicesManager; +import java.util.Arrays; +import java.util.HashSet; import java.util.List; public class MavenExtensionCompletionAndResolutionTest extends MavenDomWithIndicesTestCase { @@ -70,7 +72,7 @@ public class MavenExtensionCompletionAndResolutionTest extends MavenDomWithIndic List actual = getCompletionVariants(myProjectPom); - if (actual.isEmpty()) { + if (!new HashSet(actual).equals(new HashSet(Arrays.asList("maven-compiler-plugin", "maven-war-plugin", "maven-eclipse-plugin", "maven-surefire-plugin")))) { MavenProjectIndicesManager instance = MavenProjectIndicesManager.getInstance(myProject); System.out.println("GetArtifacts: " + instance.getArtifactIds("org.apache.maven.plugins")); System.out.println("Indexes: " + instance.getIndices()); From 69f7ea8dec3c8852b71cbe737008c27f757fe545 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 15:47:32 +0200 Subject: [PATCH 2/5] enable only run in fork mode (IDEA-83681) --- .../com/intellij/execution/junit/TestObject.java | 13 +++++++------ .../com/intellij/execution/junit/TestPackage.java | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/plugins/junit/src/com/intellij/execution/junit/TestObject.java b/plugins/junit/src/com/intellij/execution/junit/TestObject.java index 7ef35d90713f..6942a997b0b9 100644 --- a/plugins/junit/src/com/intellij/execution/junit/TestObject.java +++ b/plugins/junit/src/com/intellij/execution/junit/TestObject.java @@ -252,7 +252,7 @@ public abstract class TestObject implements JavaCommandLine { @Override public ExecutionResult execute(final Executor executor, @NotNull final ProgramRunner runner) throws ExecutionException { - final JUnitProcessHandler handler = createHandler(); + final JUnitProcessHandler handler = createHandler(executor); final RunnerSettings runnerSettings = getRunnerSettings(); JavaRunConfigurationExtensionManager.getInstance().attachExtensionsToProcess(myConfiguration, handler, runnerSettings); final TestProxy unboundOutputRoot = new TestProxy(new RootTestInfo()); @@ -360,19 +360,20 @@ public abstract class TestObject implements JavaCommandLine { TestsUIUtil.notifyByBalloon(myProject, model != null ? model.getRoot() : null, consoleProperties); } - protected JUnitProcessHandler createHandler() throws ExecutionException { - appendForkInfo(); + protected JUnitProcessHandler createHandler(Executor executor) throws ExecutionException { + appendForkInfo(executor); return JUnitProcessHandler.runCommandLine(CommandLineBuilder.createFromJavaParameters(myJavaParameters, myProject, true)); } - private void appendForkInfo() throws ExecutionException { + private void appendForkInfo(Executor executor) throws ExecutionException { final String forkMode = myConfiguration.getForkMode(); if (Comparing.strEqual(forkMode, "none")) { return; } - if (myRunnerSettings.getData() instanceof DebuggingRunnerData) { - throw new CantRunException("Debug is disabled in fork mode.
Please change fork mode to <none> to debug."); + if (myRunnerSettings.getData() != null) { + final String actionName = executor.getActionName(); + throw new CantRunException(actionName + " is disabled in fork mode.
Please change fork mode to <none> to " + actionName.toLowerCase() + "."); } final JavaParameters javaParameters = getJavaParameters(); diff --git a/plugins/junit/src/com/intellij/execution/junit/TestPackage.java b/plugins/junit/src/com/intellij/execution/junit/TestPackage.java index b4460ea4d7b9..2bb70b12c018 100644 --- a/plugins/junit/src/com/intellij/execution/junit/TestPackage.java +++ b/plugins/junit/src/com/intellij/execution/junit/TestPackage.java @@ -87,8 +87,8 @@ public class TestPackage extends TestObject { } @Override - protected JUnitProcessHandler createHandler() throws ExecutionException { - final JUnitProcessHandler handler = super.createHandler(); + protected JUnitProcessHandler createHandler(Executor executor) throws ExecutionException { + final JUnitProcessHandler handler = super.createHandler(executor); final SearchForTestsTask[] tasks = new SearchForTestsTask[1]; handler.addProcessListener(new ProcessAdapter() { @Override From bcbf3ca8a5c8b81f9fd00bbafecaf26a94e8e5fe Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 16:26:06 +0200 Subject: [PATCH 3/5] IDEA-83694: correctly process suite methods out of TestCase class --- .../junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java index fc75268f3598..9f65a8138aeb 100644 --- a/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java +++ b/plugins/junit_rt/src/com/intellij/junit4/JUnit4TestRunnerUtil.java @@ -17,7 +17,6 @@ package com.intellij.junit4; import org.junit.Ignore; import org.junit.internal.AssumptionViolatedException; -import org.junit.internal.builders.JUnit3Builder; import org.junit.internal.requests.ClassRequest; import org.junit.internal.runners.model.EachTestNotifier; import org.junit.runner.Description; @@ -151,7 +150,7 @@ public class JUnit4TestRunnerUtil { } try { if (clazz.getMethod("suite", new Class[0]) != null && !methodName.equals("suite")) { - return Request.runner(new JUnit3Builder().runnerForClass(clazz)).filterWith(Description.createTestDescription(clazz, methodName)); + return Request.classWithoutSuiteMethod(clazz).filterWith(Description.createTestDescription(clazz, methodName)); } } catch (Throwable e) { From 6e7c3616f1011c0ee87ac9f3af197cdc91840bcf Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 16:37:06 +0200 Subject: [PATCH 4/5] EA-35251 - NPE: DetectedPluginsPanel$.customizeCellRenderer --- .../impl/DetectedPluginsPanel.java | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java index b3013c4a347e..860d7c367872 100644 --- a/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java +++ b/platform/platform-impl/src/com/intellij/openapi/updateSettings/impl/DetectedPluginsPanel.java @@ -53,15 +53,17 @@ public class DetectedPluginsPanel extends OrderPanel { final int row, final int column) { final PluginDownloader downloader = (PluginDownloader)value; - append(downloader.getPluginName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); - final IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(PluginId.getId(downloader.getPluginId())); - final String loadedVersion = downloader.getPluginVersion(); - if (loadedVersion != null || (ideaPluginDescriptor != null && ideaPluginDescriptor.getVersion() != null)) { - final String installedVersion = ideaPluginDescriptor != null && ideaPluginDescriptor.getVersion() != null - ? "v. " + ideaPluginDescriptor.getVersion() + (loadedVersion != null ? " -> " : "") - : ""; - final String availableVersion = loadedVersion != null ? loadedVersion : ""; - append(" (" + installedVersion + availableVersion + ")", SimpleTextAttributes.GRAY_ATTRIBUTES); + if (downloader != null) { + append(downloader.getPluginName(), SimpleTextAttributes.REGULAR_ATTRIBUTES); + final IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(PluginId.getId(downloader.getPluginId())); + final String loadedVersion = downloader.getPluginVersion(); + if (loadedVersion != null || (ideaPluginDescriptor != null && ideaPluginDescriptor.getVersion() != null)) { + final String installedVersion = ideaPluginDescriptor != null && ideaPluginDescriptor.getVersion() != null + ? "v. " + ideaPluginDescriptor.getVersion() + (loadedVersion != null ? " -> " : "") + : ""; + final String availableVersion = loadedVersion != null ? loadedVersion : ""; + append(" (" + installedVersion + availableVersion + ")", SimpleTextAttributes.GRAY_ATTRIBUTES); + } } } }); From 99fc1e973772f6bb005cc9bdc38ea8a63815a5f9 Mon Sep 17 00:00:00 2001 From: anna Date: Thu, 29 Mar 2012 16:38:05 +0200 Subject: [PATCH 5/5] plugin installation notification text should be more user friendly (IDEA-83688) --- .../src/com/intellij/ide/plugins/ActionInstallPlugin.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java b/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java index f1399ec5e82b..7f92920f3b53 100644 --- a/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java +++ b/platform/platform-impl/src/com/intellij/ide/plugins/ActionInstallPlugin.java @@ -36,6 +36,7 @@ import com.intellij.openapi.util.text.StringUtil; import com.intellij.util.Function; import com.intellij.util.net.IOExceptionDialog; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; import javax.swing.event.HyperlinkEvent; import java.io.IOException; @@ -157,7 +158,7 @@ public class ActionInstallPlugin extends AnAction implements DumbAware { } if (needToRestart) { - notifyPluginsWereInstalled(); + notifyPluginsWereInstalled(list.size() == 1 ? list.get(0).getName() : null); } } } @@ -256,7 +257,7 @@ public class ActionInstallPlugin extends AnAction implements DumbAware { } } - private static void notifyPluginsWereInstalled() { + private static void notifyPluginsWereInstalled(@Nullable String pluginName) { final ApplicationEx app = ApplicationManagerEx.getApplicationEx(); final boolean restartCapable = app.isRestartCapable(); String message = ""; @@ -265,7 +266,8 @@ public class ActionInstallPlugin extends AnAction implements DumbAware { message += "
Restart now" : "\"shutdown\">Shutdown"; message += ""; - Notifications.Bus.notify(new Notification(IdeBundle.message("title.plugin.error"), IdeBundle.message("title.plugin.error"), + Notifications.Bus.notify(new Notification("Plugins Lifecycle Group", + pluginName != null ? "Plugin \'" + pluginName + "\' was successfully installed" : "Plugins were installed", message, NotificationType.INFORMATION, new NotificationListener() { @Override public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {