From 1f2535b3764bc9295551a4d673c0aeab90df4b31 Mon Sep 17 00:00:00 2001 From: "Anna.Kozlova" Date: Tue, 4 Oct 2016 19:19:20 +0200 Subject: [PATCH] forked mode: support until failure/until stopped (IDEA-158808) --- .../testFrameworks/ChildVMStarter.java | 30 ------------------- .../execution/junit/JUnitForkedStarter.java | 14 ++------- .../src/org/testng/TestNGForkedStarter.java | 9 +----- 3 files changed, 4 insertions(+), 49 deletions(-) delete mode 100644 java/java-runtime/src/com/intellij/rt/execution/testFrameworks/ChildVMStarter.java diff --git a/java/java-runtime/src/com/intellij/rt/execution/testFrameworks/ChildVMStarter.java b/java/java-runtime/src/com/intellij/rt/execution/testFrameworks/ChildVMStarter.java deleted file mode 100644 index 472f97778dbf..000000000000 --- a/java/java-runtime/src/com/intellij/rt/execution/testFrameworks/ChildVMStarter.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ -package com.intellij.rt.execution.testFrameworks; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.PrintStream; - -public abstract class ChildVMStarter { - - protected abstract void configureFrameworkAndRun(String[] args) throws Exception; - - //setup output wrappers - protected void startVM(String[] args) throws Exception { - configureFrameworkAndRun(args); - } -} diff --git a/plugins/junit_rt/src/com/intellij/rt/execution/junit/JUnitForkedStarter.java b/plugins/junit_rt/src/com/intellij/rt/execution/junit/JUnitForkedStarter.java index 7d88e019d24f..cbac9c739caa 100644 --- a/plugins/junit_rt/src/com/intellij/rt/execution/junit/JUnitForkedStarter.java +++ b/plugins/junit_rt/src/com/intellij/rt/execution/junit/JUnitForkedStarter.java @@ -15,29 +15,22 @@ */ package com.intellij.rt.execution.junit; -import com.intellij.rt.execution.testFrameworks.ChildVMStarter; - -import java.io.PrintStream; import java.util.ArrayList; import java.util.List; -public class JUnitForkedStarter extends ChildVMStarter { +public class JUnitForkedStarter { public static void main(String[] args) throws Exception { List argList = new ArrayList(); for (int i = 0; i < args.length; i++) { final int count = RepeatCount.getCount(args[i]); - if (count > 0) { + if (count != 0) { JUnitStarter.ourCount = count; continue; } argList.add(args[i]); } - new JUnitForkedStarter().startVM((String[])argList.toArray(new String[argList.size()])); - } - - protected void configureFrameworkAndRun(String[] args) - throws InstantiationException, IllegalAccessException, ClassNotFoundException { + args = (String[])argList.toArray(new String[argList.size()]); final String[] childTestDescription = {args[0]}; final String argentName = args[1]; final ArrayList listeners = new ArrayList(); @@ -47,5 +40,4 @@ public class JUnitForkedStarter extends ChildVMStarter { IdeaTestRunner testRunner = (IdeaTestRunner)JUnitStarter.getAgentClass(argentName).newInstance(); System.exit(testRunner.startRunnerWithArgs(childTestDescription, listeners, null, JUnitStarter.ourCount, false)); } - } diff --git a/plugins/testng_rt/src/org/testng/TestNGForkedStarter.java b/plugins/testng_rt/src/org/testng/TestNGForkedStarter.java index c2b67c092dce..882ddeb78ead 100644 --- a/plugins/testng_rt/src/org/testng/TestNGForkedStarter.java +++ b/plugins/testng_rt/src/org/testng/TestNGForkedStarter.java @@ -16,19 +16,12 @@ package org.testng; import com.beust.jcommander.JCommander; -import com.intellij.rt.execution.testFrameworks.ChildVMStarter; import org.testng.remote.RemoteArgs; -import java.io.PrintStream; import java.util.Arrays; -public class TestNGForkedStarter extends ChildVMStarter { +public class TestNGForkedStarter { public static void main(String[] args) throws Exception { - new TestNGForkedStarter().startVM(args); - } - - @Override - protected void configureFrameworkAndRun(String[] args) throws Exception { final IDEARemoteTestNG testNG = new IDEARemoteTestNG(null); CommandLineArgs cla = new CommandLineArgs(); RemoteArgs ra = new RemoteArgs();