Merge remote branch 'origin/master'

This commit is contained in:
Ekaterina Tuzova
2012-03-29 18:48:19 +04:00
6 changed files with 29 additions and 23 deletions
@@ -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 = "<html>";
@@ -265,7 +266,8 @@ public class ActionInstallPlugin extends AnAction implements DumbAware {
message += "<br><a href=";
message += restartCapable ? "\"restart\">Restart now" : "\"shutdown\">Shutdown";
message += "</a></html>";
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) {
@@ -53,15 +53,17 @@ public class DetectedPluginsPanel extends OrderPanel<PluginDownloader> {
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);
}
}
}
});
@@ -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.<br/>Please change fork mode to &lt;none&gt; to debug.");
if (myRunnerSettings.getData() != null) {
final String actionName = executor.getActionName();
throw new CantRunException(actionName + " is disabled in fork mode.<br/>Please change fork mode to &lt;none&gt; to " + actionName.toLowerCase() + ".");
}
final JavaParameters javaParameters = getJavaParameters();
@@ -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
@@ -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) {
@@ -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<String> actual = getCompletionVariants(myProjectPom);
if (actual.isEmpty()) {
if (!new HashSet<String>(actual).equals(new HashSet<String>(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());