forked mode: support until failure/until stopped (IDEA-158808)

This commit is contained in:
Anna.Kozlova
2016-10-05 10:31:37 +02:00
parent 6ddab52341
commit 1f2535b376
3 changed files with 4 additions and 49 deletions
@@ -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);
}
}
@@ -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));
}
}
@@ -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();