Merge remote-tracking branch 'origin/master'

This commit is contained in:
Dmitry Batkovich
2018-04-25 13:29:28 +03:00
6 changed files with 38 additions and 31 deletions
@@ -62,7 +62,7 @@ task setupTestDiscoveryDeps {
testDiscoveryDeps.mkdirs()
configurations.detachedConfiguration(
(dependencies
.create('org.jetbrains.testDiscovery:test-discovery-plugin-base:0.1.52') as ModuleDependency)
.create('org.jetbrains.testDiscovery:test-discovery-plugin-base:0.1.55') as ModuleDependency)
.exclude(group: 'org.codehaus.groovy', module: 'groovy-all')
).files.each { from ->
def into = Paths.get("$dir/$from.name")
@@ -1,18 +1,4 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.execution.util;
import com.intellij.execution.CantRunException;
@@ -32,6 +18,7 @@ import com.intellij.openapi.projectRoots.ProjectJdkTable;
import com.intellij.openapi.projectRoots.Sdk;
import com.intellij.openapi.projectRoots.ex.PathUtilEx;
import com.intellij.openapi.roots.*;
import com.intellij.openapi.util.DefaultJDOMExternalizer;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiClass;
@@ -41,6 +28,7 @@ import org.intellij.lang.annotations.MagicConstant;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.lang.reflect.Field;
import java.util.List;
import java.util.Map;
@@ -190,4 +178,20 @@ public class JavaParametersUtil {
throw new RuntimeConfigurationWarning(ExecutionBundle.message("jre.path.is.not.valid.jre.home.error.message", jrePath));
}
}
@SuppressWarnings("deprecation")
@NotNull
public static DefaultJDOMExternalizer.JDOMFilter getFilter(@NotNull CommonJavaRunConfigurationParameters parameters) {
return new DefaultJDOMExternalizer.JDOMFilter() {
@Override
public boolean isAccept(@NotNull Field field) {
String name = field.getName();
if ((name.equals("ALTERNATIVE_JRE_PATH_ENABLED") && !parameters.isAlternativeJrePathEnabled()) ||
(name.equals("ALTERNATIVE_JRE_PATH") && StringUtil.isEmpty(parameters.getAlternativeJrePath()))) {
return false;
}
return true;
}
};
}
}
@@ -15,7 +15,6 @@
*/
package org.jetbrains.intellij.build.images
import com.intellij.idea.Bombed
import com.intellij.openapi.application.PathManager
import com.intellij.openapi.util.io.FileUtil
import org.jetbrains.jps.model.JpsElementFactory
@@ -32,7 +31,6 @@ import org.junit.runners.Parameterized.Parameters
import java.io.File
import java.util.*
@Bombed(user = "Sergey.Malenkov", year = 2018, month = Calendar.APRIL, day = 25)
class CommunityImageResourcesSanityTest : ImageResourcesTestBase() {
companion object {
@JvmStatic
@@ -1,6 +1,7 @@
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util;
import com.intellij.icons.AllIcons;
import com.intellij.ide.FileIconPatcher;
import com.intellij.ide.FileIconProvider;
import com.intellij.ide.presentation.VirtualFilePresentation;
@@ -230,27 +231,27 @@ public class IconUtil {
@NotNull
public static Icon getAddIcon() {
return getToolbarDecoratorIcon("add.png");
return AllIcons.General.Add;
}
@NotNull
public static Icon getRemoveIcon() {
return getToolbarDecoratorIcon("remove.png");
return AllIcons.General.Remove;
}
@NotNull
public static Icon getMoveUpIcon() {
return getToolbarDecoratorIcon("moveUp.png");
return AllIcons.Actions.MoveUp;
}
@NotNull
public static Icon getMoveDownIcon() {
return getToolbarDecoratorIcon("moveDown.png");
return AllIcons.Actions.MoveDown;
}
@NotNull
public static Icon getEditIcon() {
return getToolbarDecoratorIcon("edit.png");
return AllIcons.Actions.Edit;
}
@NotNull
@@ -17,6 +17,7 @@ import com.intellij.execution.runners.ExecutionEnvironment;
import com.intellij.execution.runners.ExecutionEnvironmentBuilder;
import com.intellij.execution.testframework.TestSearchScope;
import com.intellij.execution.testframework.sm.runner.SMTRunnerConsoleProperties;
import com.intellij.execution.util.JavaParametersUtil;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.options.SettingsEditor;
@@ -441,7 +442,7 @@ public class JUnitConfiguration extends JavaTestConfigurationBase {
public void writeExternal(@NotNull final Element element) throws WriteExternalException {
super.writeExternal(element);
JavaRunConfigurationExtensionManager.getInstance().writeExternal(this, element);
DefaultJDOMExternalizer.writeExternal(this, element);
DefaultJDOMExternalizer.writeExternal(this, element, JavaParametersUtil.getFilter(this));
final Data persistentData = getPersistentData();
DefaultJDOMExternalizer.writeExternal(persistentData, element, new DifferenceFilter<>(persistentData, new Data()));
@@ -463,13 +464,16 @@ public class JUnitConfiguration extends JavaTestConfigurationBase {
element.addContent(categoryNameElement);
}
final Element patternsElement = new Element(PATTERNS_EL_NAME);
for (String o : persistentData.getPatterns()) {
final Element patternElement = new Element(PATTERN_EL_NAME);
patternElement.setAttribute(TEST_CLASS_ATT_NAME, o);
patternsElement.addContent(patternElement);
if (!persistentData.getPatterns().isEmpty()) {
final Element patternsElement = new Element(PATTERNS_EL_NAME);
for (String o : persistentData.getPatterns()) {
final Element patternElement = new Element(PATTERN_EL_NAME);
patternElement.setAttribute(TEST_CLASS_ATT_NAME, o);
patternsElement.addContent(patternElement);
}
element.addContent(patternsElement);
}
element.addContent(patternsElement);
final String forkMode = getForkMode();
if (!forkMode.equals("none")) {
final Element forkModeElement = new Element("fork_mode");
@@ -342,7 +342,7 @@ public class TestNGConfiguration extends JavaTestConfigurationBase {
public void writeExternal(@NotNull Element element) throws WriteExternalException {
super.writeExternal(element);
JavaRunConfigurationExtensionManager.getInstance().writeExternal(this, element);
DefaultJDOMExternalizer.writeExternal(this, element);
DefaultJDOMExternalizer.writeExternal(this, element, JavaParametersUtil.getFilter(this));
DefaultJDOMExternalizer.writeExternal(getPersistantData(), element, new DifferenceFilter<>(getPersistantData(), new TestData()));
EnvironmentVariablesComponent.writeExternal(element, getPersistantData().getEnvs());