diff --git a/plugins/junit/src/META-INF/plugin.xml b/plugins/junit/src/META-INF/plugin.xml
index b5b9c13aad09..3143b7959201 100644
--- a/plugins/junit/src/META-INF/plugin.xml
+++ b/plugins/junit/src/META-INF/plugin.xml
@@ -31,7 +31,7 @@
1.0
JetBrains
-
+
diff --git a/plugins/junit/src/com/intellij/execution/junit/AbstractAllInDirectoryConfigurationProducer.java b/plugins/junit/src/com/intellij/execution/junit/AbstractAllInDirectoryConfigurationProducer.java
index 665de4f87b06..f0509c4bf7ec 100644
--- a/plugins/junit/src/com/intellij/execution/junit/AbstractAllInDirectoryConfigurationProducer.java
+++ b/plugins/junit/src/com/intellij/execution/junit/AbstractAllInDirectoryConfigurationProducer.java
@@ -1,5 +1,4 @@
-// Copyright 2000-2017 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.
-
+// 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.junit;
import com.intellij.execution.actions.ConfigurationContext;
@@ -16,13 +15,18 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiPackage;
import org.jetbrains.jps.model.java.JavaSourceRootType;
-
-public abstract class AbstractAllInDirectoryConfigurationProducer extends JUnitConfigurationProducer {
-
+public class AbstractAllInDirectoryConfigurationProducer extends JUnitConfigurationProducer {
+ /**
+ * @deprecated Override {@link #getConfigurationFactory()}.
+ */
+ @Deprecated
protected AbstractAllInDirectoryConfigurationProducer(ConfigurationType configurationType) {
super(configurationType);
}
+ public AbstractAllInDirectoryConfigurationProducer() {
+ }
+
@Override
protected boolean isApplicableTestType(String type, ConfigurationContext context) {
return JUnitConfiguration.TEST_DIRECTORY.equals(type);
diff --git a/plugins/junit/src/com/intellij/execution/junit/AbstractAllInPackageConfigurationProducer.java b/plugins/junit/src/com/intellij/execution/junit/AbstractAllInPackageConfigurationProducer.java
index 9077baed44dc..8ebfb823456c 100644
--- a/plugins/junit/src/com/intellij/execution/junit/AbstractAllInPackageConfigurationProducer.java
+++ b/plugins/junit/src/com/intellij/execution/junit/AbstractAllInPackageConfigurationProducer.java
@@ -1,5 +1,4 @@
-// Copyright 2000-2017 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.
-
+// 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.junit;
import com.intellij.execution.actions.ConfigurationContext;
@@ -11,13 +10,18 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiPackage;
import com.siyeh.ig.junit.JUnitCommonClassNames;
-
public abstract class AbstractAllInPackageConfigurationProducer extends JUnitConfigurationProducer {
-
+ /**
+ * @deprecated Override {@link #getConfigurationFactory()}.
+ */
+ @Deprecated
protected AbstractAllInPackageConfigurationProducer(ConfigurationType configurationType) {
super(configurationType);
}
+ protected AbstractAllInPackageConfigurationProducer() {
+ }
+
@Override
protected boolean isApplicableTestType(String type, ConfigurationContext context) {
return JUnitConfiguration.TEST_PACKAGE.equals(type);
diff --git a/plugins/junit/src/com/intellij/execution/junit/AllInDirectoryConfigurationProducer.java b/plugins/junit/src/com/intellij/execution/junit/AllInDirectoryConfigurationProducer.java
index dcdd1422bcae..6b5bff24cc2f 100644
--- a/plugins/junit/src/com/intellij/execution/junit/AllInDirectoryConfigurationProducer.java
+++ b/plugins/junit/src/com/intellij/execution/junit/AllInDirectoryConfigurationProducer.java
@@ -1,22 +1,9 @@
-/*
- * Copyright 2000-2015 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.junit;
+@SuppressWarnings("unused")
+@Deprecated
public class AllInDirectoryConfigurationProducer extends AbstractAllInDirectoryConfigurationProducer {
public AllInDirectoryConfigurationProducer() {
- super(JUnitConfigurationType.getInstance());
}
}
diff --git a/plugins/junit/src/com/intellij/execution/junit/AllInPackageConfigurationProducer.java b/plugins/junit/src/com/intellij/execution/junit/AllInPackageConfigurationProducer.java
index 31679acd10ed..f2583e6be96f 100644
--- a/plugins/junit/src/com/intellij/execution/junit/AllInPackageConfigurationProducer.java
+++ b/plugins/junit/src/com/intellij/execution/junit/AllInPackageConfigurationProducer.java
@@ -1,22 +1,5 @@
-/*
- * Copyright 2000-2015 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.junit;
public class AllInPackageConfigurationProducer extends AbstractAllInPackageConfigurationProducer {
- public AllInPackageConfigurationProducer() {
- super(JUnitConfigurationType.getInstance());
- }
}
diff --git a/plugins/junit/src/com/intellij/execution/junit/JUnitConfigurationProducer.java b/plugins/junit/src/com/intellij/execution/junit/JUnitConfigurationProducer.java
index 1e6c4ec6e9be..a07cce2ad0a5 100644
--- a/plugins/junit/src/com/intellij/execution/junit/JUnitConfigurationProducer.java
+++ b/plugins/junit/src/com/intellij/execution/junit/JUnitConfigurationProducer.java
@@ -1,31 +1,27 @@
-/*
- * Copyright 2000-2009 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.junit;
+import com.intellij.execution.configurations.ConfigurationFactory;
import com.intellij.execution.configurations.ConfigurationType;
import com.intellij.execution.testframework.AbstractJavaTestConfigurationProducer;
+import org.jetbrains.annotations.NotNull;
public abstract class JUnitConfigurationProducer extends AbstractJavaTestConfigurationProducer implements Cloneable {
-
public JUnitConfigurationProducer() {
- super(JUnitConfigurationType.getInstance());
+ super();
}
+ /**
+ * @deprecated Override {@link #getConfigurationFactory()}.
+ */
+ @Deprecated
protected JUnitConfigurationProducer(ConfigurationType configurationType) {
super(configurationType);
}
+
+ @NotNull
+ @Override
+ public ConfigurationFactory getConfigurationFactory() {
+ return JUnitConfigurationType.getInstance().getConfigurationFactories()[0];
+ }
}
diff --git a/plugins/junit/src/com/intellij/execution/junit/TestInClassConfigurationProducer.java b/plugins/junit/src/com/intellij/execution/junit/TestInClassConfigurationProducer.java
index 3eb8c839d8b4..eebe4ec289ab 100644
--- a/plugins/junit/src/com/intellij/execution/junit/TestInClassConfigurationProducer.java
+++ b/plugins/junit/src/com/intellij/execution/junit/TestInClassConfigurationProducer.java
@@ -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.junit;
import com.intellij.execution.actions.ConfigurationContext;
@@ -23,11 +9,8 @@ import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiMember;
import org.jetbrains.annotations.NotNull;
-public class TestInClassConfigurationProducer extends JUnitConfigurationProducer {
+public final class TestInClassConfigurationProducer extends JUnitConfigurationProducer {
private final JUnitInClassConfigurationProducerDelegate myDelegate = new JUnitInClassConfigurationProducerDelegate();
- public TestInClassConfigurationProducer() {
- super(JUnitConfigurationType.getInstance());
- }
@Override
protected boolean setupConfigurationFromContext(JUnitConfiguration configuration,
diff --git a/plugins/junit/src/com/intellij/execution/junit/UniqueIdConfigurationProducer.java b/plugins/junit/src/com/intellij/execution/junit/UniqueIdConfigurationProducer.java
index 554ab413f61f..e5c229995e0b 100644
--- a/plugins/junit/src/com/intellij/execution/junit/UniqueIdConfigurationProducer.java
+++ b/plugins/junit/src/com/intellij/execution/junit/UniqueIdConfigurationProducer.java
@@ -1,5 +1,4 @@
-// Copyright 2000-2017 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.
-
+// 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.junit;
import com.intellij.execution.actions.ConfigurationContext;
@@ -16,13 +15,7 @@ import org.jetbrains.annotations.NotNull;
import java.util.Arrays;
import java.util.Objects;
-
public class UniqueIdConfigurationProducer extends JUnitConfigurationProducer {
-
- protected UniqueIdConfigurationProducer() {
- super(JUnitConfigurationType.getInstance());
- }
-
@Override
protected boolean setupConfigurationFromContext(JUnitConfiguration configuration,
ConfigurationContext context,
@@ -50,10 +43,10 @@ public class UniqueIdConfigurationProducer extends JUnitConfigurationProducer {
RunConfiguration runConfiguration = dataContext.getData(RunConfiguration.DATA_KEY);
if (!(runConfiguration instanceof JUnitConfiguration)) return null;
Module module = ((JUnitConfiguration)runConfiguration).getConfigurationModule().getModule();
-
+
GlobalSearchScope searchScope =
module != null ? GlobalSearchScope.moduleWithDependenciesScope(module) : GlobalSearchScope.projectScope(context.getProject());
- return
+ return
Arrays.stream(testProxies).map(testProxy -> TestUniqueId.getEffectiveNodeId(testProxy, context.getProject(), searchScope))
.filter(Objects::nonNull)
.toArray(String[]::new);