mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
fork tests: extract 'forked by module', splitter/starter; convert params chain to fields, move from junit package
This commit is contained in:
@@ -1,262 +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.junit;
|
||||
|
||||
import com.intellij.rt.execution.CommandLineWrapper;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ForkedStarter {
|
||||
protected final ForkedDebuggerStarter myForkedDebuggerStarter = new ForkedDebuggerStarter();
|
||||
|
||||
//setup output wrappers
|
||||
protected void startVM(String[] args) throws Exception {
|
||||
final String testOutputPath = args[0];
|
||||
final File file = new File(testOutputPath);
|
||||
if (!file.exists()) {
|
||||
if (!file.createNewFile()) return;
|
||||
}
|
||||
final FileOutputStream stream = new FileOutputStream(testOutputPath);
|
||||
//noinspection UseOfSystemOutOrSystemErr
|
||||
PrintStream oldOut = System.out;
|
||||
//noinspection UseOfSystemOutOrSystemErr
|
||||
PrintStream oldErr = System.err;
|
||||
try {
|
||||
final PrintStream out = new PrintStream(new ForkedVMWrapper(stream, false));
|
||||
final PrintStream err = new PrintStream(new ForkedVMWrapper(stream, true));
|
||||
System.setOut(out);
|
||||
System.setErr(err);
|
||||
configureFrameworkAndRun(args, out, err);
|
||||
}
|
||||
finally {
|
||||
System.setOut(oldOut);
|
||||
System.setErr(oldErr);
|
||||
stream.close();
|
||||
}
|
||||
}
|
||||
|
||||
//read output from wrappers
|
||||
protected int runChild(PrintStream out,
|
||||
PrintStream err,
|
||||
List vmParameters,
|
||||
List args,
|
||||
File workingDir,
|
||||
String classpath,
|
||||
String dynamicClasspath) throws IOException, InterruptedException {
|
||||
vmParameters = new ArrayList(vmParameters);
|
||||
|
||||
myForkedDebuggerStarter.setupDebugger(vmParameters);
|
||||
//noinspection SSBasedInspection
|
||||
final File tempFile = File.createTempFile("fork", "test");
|
||||
tempFile.deleteOnExit();
|
||||
final String testOutputPath = tempFile.getAbsolutePath();
|
||||
|
||||
final ProcessBuilder builder = new ProcessBuilder();
|
||||
builder.add(vmParameters);
|
||||
builder.add("-classpath");
|
||||
if (dynamicClasspath.length() > 0) {
|
||||
try {
|
||||
final File classpathFile = File.createTempFile("classpath", null);
|
||||
classpathFile.deleteOnExit();
|
||||
final PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(classpathFile), "UTF-8"));
|
||||
try {
|
||||
int idx = 0;
|
||||
while (idx < classpath.length()) {
|
||||
final int endIdx = classpath.indexOf(File.pathSeparator, idx);
|
||||
if (endIdx < 0) {
|
||||
writer.println(classpath.substring(idx));
|
||||
break;
|
||||
}
|
||||
writer.println(classpath.substring(idx, endIdx));
|
||||
idx = endIdx + File.pathSeparator.length();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
writer.close();
|
||||
}
|
||||
|
||||
builder.add(dynamicClasspath);
|
||||
builder.add(CommandLineWrapper.class.getName());
|
||||
builder.add(classpathFile.getAbsolutePath());
|
||||
}
|
||||
catch (Throwable e) {
|
||||
builder.add(classpath);
|
||||
}
|
||||
}
|
||||
else {
|
||||
builder.add(classpath);
|
||||
}
|
||||
|
||||
builder.add(getStarterName());
|
||||
builder.add(testOutputPath);
|
||||
builder.add(args);
|
||||
builder.setWorkingDir(workingDir);
|
||||
|
||||
final Process exec = builder.createProcess();
|
||||
final int result = exec.waitFor();
|
||||
ForkedVMWrapper.readWrapped(testOutputPath, (PrintStream)out, (PrintStream)err);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected int processChildren(List args,
|
||||
Object out,
|
||||
Object err,
|
||||
List parameters,
|
||||
List children,
|
||||
int result,
|
||||
boolean forkTillMethod,
|
||||
File workingDir,
|
||||
String classpath,
|
||||
String dynamicClasspath) throws IOException, InterruptedException {
|
||||
for (int i = 0, argsLength = children.size(); i < argsLength; i++) {
|
||||
final Object child = children.get(i);
|
||||
final List childTests = getChildren(child);
|
||||
final int childResult;
|
||||
if (childTests.isEmpty() || !forkTillMethod) {
|
||||
childResult = runChild(wrapOutputStream((OutputStream)out), wrapOutputStream((OutputStream)err),
|
||||
parameters, createChildArgs(args, child), workingDir, classpath, dynamicClasspath);
|
||||
}
|
||||
else {
|
||||
childResult =
|
||||
processChildren(args, out, err, parameters, childTests, result, forkTillMethod, workingDir, classpath, dynamicClasspath);
|
||||
}
|
||||
result = Math.min(childResult, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int startForkedVM(String workingDirsPath,
|
||||
String[] args,
|
||||
String configName,
|
||||
Object out,
|
||||
Object err,
|
||||
String forkMode,
|
||||
String commandLinePath, List newArgs) throws Exception {
|
||||
args = myForkedDebuggerStarter.excludeDebugPortFromArgs(args);
|
||||
|
||||
final List parameters = new ArrayList();
|
||||
final BufferedReader bufferedReader = new BufferedReader(new FileReader(commandLinePath));
|
||||
final String dynamicClasspath = bufferedReader.readLine();
|
||||
try {
|
||||
String line;
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
parameters.add(line);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
bufferedReader.close();
|
||||
}
|
||||
|
||||
final Object rootDescription = createRootDescription(args, newArgs, configName, out, err);
|
||||
if (rootDescription == null) return -1;
|
||||
|
||||
sendTree(rootDescription);
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
|
||||
int result = 0;
|
||||
if (workingDirsPath == null || new File(workingDirsPath).length() == 0) {
|
||||
final List children = getChildren(rootDescription);
|
||||
final boolean forkTillMethod = forkMode.equalsIgnoreCase("method");
|
||||
result = processChildren(newArgs, out, err, parameters, children, 0, forkTillMethod, null, System.getProperty("java.class.path"), dynamicClasspath);
|
||||
} else {
|
||||
final BufferedReader perDirReader = new BufferedReader(new FileReader(workingDirsPath));
|
||||
try {
|
||||
final String packageName = perDirReader.readLine();
|
||||
String workingDir;
|
||||
while ((workingDir = perDirReader.readLine()) != null) {
|
||||
final String moduleName = perDirReader.readLine();
|
||||
final String classpath = perDirReader.readLine();
|
||||
try {
|
||||
|
||||
List classNames = new ArrayList();
|
||||
final int classNamesSize = Integer.parseInt(perDirReader.readLine());
|
||||
for (int i = 0; i < classNamesSize; i++) {
|
||||
String className = perDirReader.readLine();
|
||||
if (className == null) {
|
||||
System.err.println("Class name is expected. Working dir: " + workingDir);
|
||||
return -1;
|
||||
}
|
||||
classNames.add(className);
|
||||
}
|
||||
|
||||
final Object rootDescriptor = findByClassName((String)classNames.get(0), rootDescription);
|
||||
final int childResult;
|
||||
final File dir = new File(workingDir);
|
||||
if (forkMode.equals("none")) {
|
||||
final List childArgs = createChildArgsForClasses(newArgs, moduleName, packageName, workingDir, classNames, rootDescriptor);
|
||||
childResult = runChild(wrapOutputStream((OutputStream)out),
|
||||
wrapOutputStream((OutputStream)err),
|
||||
parameters, childArgs, dir, classpath, dynamicClasspath);
|
||||
}
|
||||
else {
|
||||
final List children = new ArrayList(getChildren(rootDescription));
|
||||
for (Iterator iterator = children.iterator(); iterator.hasNext(); ) {
|
||||
if (!classNames.contains(getTestClassName(iterator.next()))) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
final boolean forkTillMethod = forkMode.equalsIgnoreCase("method");
|
||||
childResult = processChildren(newArgs, out, err, parameters, children, result, forkTillMethod, dir, classpath, dynamicClasspath);
|
||||
}
|
||||
result = Math.min(childResult, result);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
perDirReader.close();
|
||||
}
|
||||
}
|
||||
|
||||
myForkedDebuggerStarter.closeDebugSocket();
|
||||
sendTime(time);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected abstract List createChildArgsForClasses(List newArgs,
|
||||
String moduleName,
|
||||
String packageName,
|
||||
String workingDir,
|
||||
List classNames,
|
||||
Object rootDescriptor) throws IOException;
|
||||
|
||||
protected abstract Object createRootDescription(String[] args, List newArgs, String configName, Object out, Object err) throws Exception;
|
||||
|
||||
protected void sendTree(Object rootDescription) {}
|
||||
protected void sendTime(long time) {}
|
||||
|
||||
protected abstract Object findByClassName(String className, Object rootDescription);
|
||||
|
||||
protected abstract String getTestClassName(Object child);
|
||||
|
||||
protected abstract List createChildArgs(List args, Object child);
|
||||
|
||||
protected abstract List getChildren(Object child);
|
||||
|
||||
protected PrintStream wrapOutputStream(OutputStream out) {
|
||||
return (PrintStream)out;
|
||||
}
|
||||
|
||||
protected abstract String getStarterName();
|
||||
|
||||
protected abstract void configureFrameworkAndRun(String[] args, PrintStream out, PrintStream err) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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, PrintStream out, PrintStream err) throws Exception;
|
||||
|
||||
//setup output wrappers
|
||||
protected void startVM(String[] args) throws Exception {
|
||||
final String testOutputPath = args[0];
|
||||
final File file = new File(testOutputPath);
|
||||
if (!file.exists()) {
|
||||
if (!file.createNewFile()) return;
|
||||
}
|
||||
final FileOutputStream stream = new FileOutputStream(testOutputPath);
|
||||
//noinspection UseOfSystemOutOrSystemErr
|
||||
PrintStream oldOut = System.out;
|
||||
//noinspection UseOfSystemOutOrSystemErr
|
||||
PrintStream oldErr = System.err;
|
||||
try {
|
||||
final PrintStream out = new PrintStream(new ForkedVMWrapper(stream, false));
|
||||
final PrintStream err = new PrintStream(new ForkedVMWrapper(stream, true));
|
||||
System.setOut(out);
|
||||
System.setErr(err);
|
||||
configureFrameworkAndRun(args, out, err);
|
||||
}
|
||||
finally {
|
||||
System.setOut(oldOut);
|
||||
System.setErr(oldErr);
|
||||
stream.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
+175
@@ -0,0 +1,175 @@
|
||||
/*
|
||||
* 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 com.intellij.rt.execution.CommandLineWrapper;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ForkedByModuleSplitter {
|
||||
protected final ForkedDebuggerHelper myForkedDebuggerHelper = new ForkedDebuggerHelper();
|
||||
protected final String myWorkingDirsPath;
|
||||
protected final String myForkMode;
|
||||
protected final PrintStream myOut;
|
||||
protected final PrintStream myErr;
|
||||
protected final List myNewArgs;
|
||||
protected String myDynamicClasspath;
|
||||
protected List myVMParameters;
|
||||
|
||||
public ForkedByModuleSplitter(String workingDirsPath, String forkMode, PrintStream out, PrintStream err, List newArgs) {
|
||||
myWorkingDirsPath = workingDirsPath;
|
||||
myForkMode = forkMode;
|
||||
myOut = out;
|
||||
myErr = err;
|
||||
myNewArgs = newArgs;
|
||||
}
|
||||
|
||||
public int startSplitting(String[] args,
|
||||
String configName,
|
||||
String commandLinePath) throws Exception {
|
||||
args = myForkedDebuggerHelper.excludeDebugPortFromArgs(args);
|
||||
|
||||
myVMParameters = new ArrayList();
|
||||
final BufferedReader bufferedReader = new BufferedReader(new FileReader(commandLinePath));
|
||||
myDynamicClasspath = bufferedReader.readLine();
|
||||
try {
|
||||
String line;
|
||||
while ((line = bufferedReader.readLine()) != null) {
|
||||
myVMParameters.add(line);
|
||||
}
|
||||
}
|
||||
finally {
|
||||
bufferedReader.close();
|
||||
}
|
||||
|
||||
long time = System.currentTimeMillis();
|
||||
int result = startSplitting(args, configName);
|
||||
myForkedDebuggerHelper.closeDebugSocket();
|
||||
sendTime(time);
|
||||
return result;
|
||||
}
|
||||
|
||||
//read output from wrappers
|
||||
protected int startChildFork(List args, File workingDir, String classpath) throws IOException, InterruptedException {
|
||||
List vmParameters = new ArrayList(myVMParameters);
|
||||
|
||||
myForkedDebuggerHelper.setupDebugger(vmParameters);
|
||||
//noinspection SSBasedInspection
|
||||
final File tempFile = File.createTempFile("fork", "test");
|
||||
tempFile.deleteOnExit();
|
||||
final String testOutputPath = tempFile.getAbsolutePath();
|
||||
|
||||
final ProcessBuilder builder = new ProcessBuilder();
|
||||
builder.add(vmParameters);
|
||||
builder.add("-classpath");
|
||||
if (myDynamicClasspath.length() > 0) {
|
||||
try {
|
||||
final File classpathFile = File.createTempFile("classpath", null);
|
||||
classpathFile.deleteOnExit();
|
||||
final PrintWriter writer = new PrintWriter(new OutputStreamWriter(new FileOutputStream(classpathFile), "UTF-8"));
|
||||
try {
|
||||
int idx = 0;
|
||||
while (idx < classpath.length()) {
|
||||
final int endIdx = classpath.indexOf(File.pathSeparator, idx);
|
||||
if (endIdx < 0) {
|
||||
writer.println(classpath.substring(idx));
|
||||
break;
|
||||
}
|
||||
writer.println(classpath.substring(idx, endIdx));
|
||||
idx = endIdx + File.pathSeparator.length();
|
||||
}
|
||||
}
|
||||
finally {
|
||||
writer.close();
|
||||
}
|
||||
|
||||
builder.add(myDynamicClasspath);
|
||||
builder.add(CommandLineWrapper.class.getName());
|
||||
builder.add(classpathFile.getAbsolutePath());
|
||||
}
|
||||
catch (Throwable e) {
|
||||
builder.add(classpath);
|
||||
}
|
||||
}
|
||||
else {
|
||||
builder.add(classpath);
|
||||
}
|
||||
|
||||
builder.add(getStarterName());
|
||||
builder.add(testOutputPath);
|
||||
builder.add(args);
|
||||
builder.setWorkingDir(workingDir);
|
||||
|
||||
final Process exec = builder.createProcess();
|
||||
final int result = exec.waitFor();
|
||||
ForkedVMWrapper.readWrapped(testOutputPath, myOut, myErr);
|
||||
return result;
|
||||
}
|
||||
|
||||
//read file with classes grouped by module
|
||||
protected int splitPerModule() throws IOException {
|
||||
int result = 0;
|
||||
final BufferedReader perDirReader = new BufferedReader(new FileReader(myWorkingDirsPath));
|
||||
try {
|
||||
final String packageName = perDirReader.readLine();
|
||||
String workingDir;
|
||||
while ((workingDir = perDirReader.readLine()) != null) {
|
||||
final String moduleName = perDirReader.readLine();
|
||||
final String classpath = perDirReader.readLine();
|
||||
try {
|
||||
|
||||
List classNames = new ArrayList();
|
||||
final int classNamesSize = Integer.parseInt(perDirReader.readLine());
|
||||
for (int i = 0; i < classNamesSize; i++) {
|
||||
String className = perDirReader.readLine();
|
||||
if (className == null) {
|
||||
System.err.println("Class name is expected. Working dir: " + workingDir);
|
||||
result = -1;
|
||||
break;
|
||||
}
|
||||
classNames.add(className);
|
||||
}
|
||||
|
||||
final int childResult = startPerModuleFork(moduleName, classNames, packageName, workingDir, classpath, result);
|
||||
result = Math.min(childResult, result);
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
finally {
|
||||
perDirReader.close();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected abstract int startSplitting(String[] args, String configName) throws Exception;
|
||||
|
||||
protected abstract int startPerModuleFork(String moduleName,
|
||||
List classNames,
|
||||
String packageName,
|
||||
String workingDir,
|
||||
String classpath,
|
||||
int result) throws Exception;
|
||||
|
||||
protected abstract String getStarterName();
|
||||
|
||||
protected void sendTime(long time) {}
|
||||
protected void sendTree(Object rootDescription) {}
|
||||
}
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.rt.execution.junit;
|
||||
package com.intellij.rt.execution.testFrameworks;
|
||||
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
@@ -23,7 +23,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ForkedDebuggerStarter {
|
||||
public class ForkedDebuggerHelper {
|
||||
public static final String DEBUG_SOCKET = "-debugSocket";
|
||||
private int myDebugPort = -1;
|
||||
private Socket myDebugSocket;
|
||||
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* 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.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ForkedSplitter extends ForkedByModuleSplitter {
|
||||
|
||||
private Object myRootDescription;
|
||||
|
||||
public ForkedSplitter(String workingDirsPath, String forkMode, PrintStream out, PrintStream err, List newArgs) {
|
||||
super(workingDirsPath, forkMode, out, err, newArgs);
|
||||
}
|
||||
|
||||
protected int startSplitting(String[] args,
|
||||
String configName) throws Exception {
|
||||
myRootDescription = createRootDescription(args, configName);
|
||||
if (myRootDescription == null) {
|
||||
return -1;
|
||||
}
|
||||
sendTree(myRootDescription);
|
||||
if (myWorkingDirsPath == null || new File(myWorkingDirsPath).length() == 0) {
|
||||
final List children = getChildren(myRootDescription);
|
||||
final boolean forkTillMethod = myForkMode.equalsIgnoreCase("method");
|
||||
return splitChildren(children, 0, forkTillMethod, null, System.getProperty("java.class.path")
|
||||
);
|
||||
}
|
||||
else {
|
||||
return splitPerModule();
|
||||
}
|
||||
}
|
||||
|
||||
protected int startPerModuleFork(String moduleName,
|
||||
List classNames,
|
||||
String packageName,
|
||||
String workingDir,
|
||||
String classpath,
|
||||
int result) throws Exception {
|
||||
if (myForkMode.equals("none")) {
|
||||
final List childArgs = createPerModuleArgs(packageName, workingDir, classNames, myRootDescription);
|
||||
return startChildFork(childArgs, new File(workingDir), classpath);
|
||||
}
|
||||
else {
|
||||
final List children = new ArrayList(getChildren(myRootDescription));
|
||||
for (Iterator iterator = children.iterator(); iterator.hasNext(); ) {
|
||||
if (!classNames.contains(getTestClassName(iterator.next()))) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
final boolean forkTillMethod = myForkMode.equalsIgnoreCase("method");
|
||||
return splitChildren(children, result, forkTillMethod, new File(workingDir), classpath);
|
||||
}
|
||||
}
|
||||
|
||||
protected int splitChildren(List children,
|
||||
int result,
|
||||
boolean forkTillMethod,
|
||||
File workingDir,
|
||||
String classpath) throws IOException, InterruptedException {
|
||||
for (int i = 0, argsLength = children.size(); i < argsLength; i++) {
|
||||
final Object child = children.get(i);
|
||||
final List childTests = getChildren(child);
|
||||
final int childResult;
|
||||
if (childTests.isEmpty() || !forkTillMethod) {
|
||||
childResult = startChildFork(createChildArgs(child), workingDir, classpath);
|
||||
}
|
||||
else {
|
||||
childResult = splitChildren(childTests, result, forkTillMethod, workingDir, classpath);
|
||||
}
|
||||
result = Math.min(childResult, result);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected abstract List createPerModuleArgs(String packageName, String workingDir, List classNames, Object rootDescriptor) throws IOException;
|
||||
|
||||
protected abstract Object createRootDescription(String[] args, String configName) throws Exception;
|
||||
|
||||
protected abstract String getTestClassName(Object child);
|
||||
|
||||
protected abstract List createChildArgs(Object child);
|
||||
|
||||
protected abstract List getChildren(Object child);
|
||||
}
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.rt.execution.junit;
|
||||
package com.intellij.rt.execution.testFrameworks;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.rt.execution.junit;
|
||||
package com.intellij.rt.execution.testFrameworks;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
@@ -50,6 +50,7 @@ import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.refactoring.listeners.RefactoringElementListener;
|
||||
import com.intellij.rt.execution.junit.*;
|
||||
import com.intellij.rt.execution.testFrameworks.ForkedDebuggerHelper;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.PathUtil;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
@@ -402,7 +403,7 @@ public abstract class TestObject extends JavaTestFrameworkRunnableState<JUnitCon
|
||||
protected void passForkMode(String forkMode, File tempFile, JavaParameters parameters) throws ExecutionException {
|
||||
parameters.getProgramParametersList().add("@@@" + forkMode + ',' + tempFile.getAbsolutePath());
|
||||
if (getForkSocket() != null) {
|
||||
parameters.getProgramParametersList().add(ForkedDebuggerStarter.DEBUG_SOCKET + getForkSocket().getLocalPort());
|
||||
parameters.getProgramParametersList().add(ForkedDebuggerHelper.DEBUG_SOCKET + getForkSocket().getLocalPort());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,10 +83,12 @@ public class JUnitClasspathTest extends JavaCodeInsightFixtureTestCase {
|
||||
String file = preparePathsForComparison(FileUtil.loadFile(workingDirsFile), mod1, mod2);
|
||||
assertEquals("p\n" +
|
||||
"MODULE_1\n" +
|
||||
"mod1\n" +
|
||||
"IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
|
||||
"1\n" +
|
||||
"p.T1\n" +
|
||||
"MODULE_2\n" +
|
||||
"mod2\n" +
|
||||
"IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
|
||||
"1\n" +
|
||||
"p.T2\n", file);
|
||||
@@ -99,11 +101,13 @@ public class JUnitClasspathTest extends JavaCodeInsightFixtureTestCase {
|
||||
file = preparePathsForComparison(FileUtil.loadFile(workingDirsFile), mod1, mod2);
|
||||
assertEquals("p\n" +
|
||||
"MODULE_1\n" +
|
||||
"SERVICE_MESSAGES;IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
|
||||
"mod1\n" +
|
||||
"IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
|
||||
"1\n" +
|
||||
"p.T1\n" +
|
||||
"MODULE_2\n" +
|
||||
"SERVICE_MESSAGES;IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
|
||||
"mod2\n" +
|
||||
"IDEA_HOME/lib/junit-4.12.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/annotations.jar;IDEA_HOME/java/mockJDK-1.8/jre/lib/rt.jar\n" +
|
||||
"1\n" +
|
||||
"p.T2\n", file);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* 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.junit;
|
||||
|
||||
import com.intellij.rt.execution.junit.segments.OutputObjectRegistry;
|
||||
import com.intellij.rt.execution.testFrameworks.ForkedSplitter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author anna
|
||||
* @since 6.04.2011
|
||||
*/
|
||||
public class JUnitForkedSplitter extends ForkedSplitter {
|
||||
|
||||
private IdeaTestRunner myTestRunner;
|
||||
|
||||
public JUnitForkedSplitter(String workingDirsPath, String forkMode, PrintStream out, PrintStream err, List newArgs) {
|
||||
super(workingDirsPath, forkMode, out, err, newArgs);
|
||||
}
|
||||
|
||||
|
||||
protected String getStarterName() {
|
||||
return JUnitForkedStarter.class.getName();
|
||||
}
|
||||
|
||||
protected Object createRootDescription(String[] args, String configName)
|
||||
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
myTestRunner = (IdeaTestRunner)JUnitStarter.getAgentClass(Boolean.valueOf((String)myNewArgs.get(0)).booleanValue()).newInstance();
|
||||
myTestRunner.setStreams(myOut, myErr, 0);
|
||||
return myTestRunner.getTestToStart(args, configName);
|
||||
}
|
||||
|
||||
protected void sendTree(Object rootDescription) {
|
||||
TreeSender.sendTree(myTestRunner, rootDescription, !JUnitStarter.SM_RUNNER);
|
||||
}
|
||||
|
||||
protected void sendTime(long time) {
|
||||
if (!JUnitStarter.SM_RUNNER) {
|
||||
new TimeSender(myTestRunner.getRegistry()).printHeader(System.currentTimeMillis() - time);
|
||||
}
|
||||
}
|
||||
|
||||
protected Object findByClassName(String className, Object rootDescription) {
|
||||
final List children = getChildren(rootDescription);
|
||||
for (int i = 0; i < children.size(); i++) {
|
||||
Object child = children.get(i);
|
||||
if (className.equals(getTestClassName(child))) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < children.size(); i++) {
|
||||
final Object byName = findByClassName( className, children.get(i));
|
||||
if (byName != null) return byName;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected String getTestClassName(Object child) {
|
||||
return myTestRunner.getTestClassName(child);
|
||||
}
|
||||
|
||||
protected List createChildArgs(Object child) {
|
||||
List newArgs = new ArrayList();
|
||||
final OutputObjectRegistry registry = myTestRunner.getRegistry();
|
||||
newArgs.add(String.valueOf(registry != null ? registry.getKnownObject(child) : -1));
|
||||
newArgs.add(myTestRunner.getStartDescription(child));
|
||||
newArgs.addAll(myNewArgs);
|
||||
return newArgs;
|
||||
}
|
||||
|
||||
protected List createPerModuleArgs(String packageName,
|
||||
String workingDir,
|
||||
List classNames,
|
||||
Object rootDescription) throws IOException {
|
||||
File tempFile = File.createTempFile("idea_junit", ".tmp");
|
||||
tempFile.deleteOnExit();
|
||||
JUnitStarter.printClassesList(classNames, packageName + ", working directory: \'" + workingDir + "\'", "", tempFile);
|
||||
final OutputObjectRegistry registry = myTestRunner.getRegistry();
|
||||
final String startIndex;
|
||||
if (registry != null) {
|
||||
startIndex = String.valueOf(registry.getKnownObject(findByClassName((String)classNames.get(0), rootDescription)));
|
||||
}
|
||||
else {
|
||||
startIndex = "-1";
|
||||
}
|
||||
final List childArgs = new ArrayList();
|
||||
childArgs.add(startIndex);
|
||||
childArgs.add("@" + tempFile.getAbsolutePath());
|
||||
childArgs.addAll(myNewArgs);
|
||||
return childArgs;
|
||||
}
|
||||
|
||||
|
||||
protected List getChildren(Object child) {
|
||||
return myTestRunner.getChildTests(child);
|
||||
}
|
||||
}
|
||||
@@ -15,29 +15,18 @@
|
||||
*/
|
||||
package com.intellij.rt.execution.junit;
|
||||
|
||||
import com.intellij.rt.execution.junit.segments.OutputObjectRegistry;
|
||||
import com.intellij.rt.execution.junit.segments.SegmentedOutputStream;
|
||||
import com.intellij.rt.execution.testFrameworks.ChildVMStarter;
|
||||
|
||||
import java.io.*;
|
||||
import java.io.PrintStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author anna
|
||||
* @since 6.04.2011
|
||||
*/
|
||||
public class JUnitForkedStarter extends ForkedStarter {
|
||||
public class JUnitForkedStarter extends ChildVMStarter {
|
||||
|
||||
private IdeaTestRunner myTestRunner;
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
new JUnitForkedStarter().startVM(args);
|
||||
}
|
||||
|
||||
protected String getStarterName() {
|
||||
return JUnitForkedStarter.class.getName();
|
||||
}
|
||||
|
||||
protected void configureFrameworkAndRun(String[] args, PrintStream out, PrintStream err)
|
||||
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
final int lastIdx = Integer.parseInt(args[1]);
|
||||
@@ -53,76 +42,4 @@ public class JUnitForkedStarter extends ForkedStarter {
|
||||
System.exit(testRunner.startRunnerWithArgs(childTestDescription, listeners, null, 1, false));
|
||||
}
|
||||
|
||||
protected Object createRootDescription(String[] args, List newArgs, String configName, Object out, Object err)
|
||||
throws InstantiationException, IllegalAccessException, ClassNotFoundException {
|
||||
myTestRunner = (IdeaTestRunner)JUnitStarter.getAgentClass(Boolean.valueOf((String)newArgs.get(0)).booleanValue()).newInstance();
|
||||
myTestRunner.setStreams(out, err, 0);
|
||||
return myTestRunner.getTestToStart(args, configName);
|
||||
}
|
||||
|
||||
protected void sendTree(Object rootDescription) {
|
||||
TreeSender.sendTree(myTestRunner, rootDescription, !JUnitStarter.SM_RUNNER);
|
||||
}
|
||||
|
||||
protected void sendTime(long time) {
|
||||
if (!JUnitStarter.SM_RUNNER) {
|
||||
new TimeSender(myTestRunner.getRegistry()).printHeader(System.currentTimeMillis() - time);
|
||||
}
|
||||
}
|
||||
|
||||
protected Object findByClassName(String className, Object rootDescription) {
|
||||
final List children = getChildren(rootDescription);
|
||||
for (int i = 0; i < children.size(); i++) {
|
||||
Object child = children.get(i);
|
||||
if (className.equals(getTestClassName(child))) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < children.size(); i++) {
|
||||
final Object byName = findByClassName( className, children.get(i));
|
||||
if (byName != null) return byName;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected String getTestClassName(Object child) {
|
||||
return myTestRunner.getTestClassName(child);
|
||||
}
|
||||
|
||||
protected List createChildArgs(List args, Object child) {
|
||||
List newArgs = new ArrayList();
|
||||
final OutputObjectRegistry registry = myTestRunner.getRegistry();
|
||||
newArgs.add(String.valueOf(registry != null ? registry.getKnownObject(child) : -1));
|
||||
newArgs.add(myTestRunner.getStartDescription(child));
|
||||
newArgs.addAll(args);
|
||||
return newArgs;
|
||||
}
|
||||
|
||||
protected List createChildArgsForClasses(List newArgs,
|
||||
String moduleName,
|
||||
String packageName,
|
||||
String workingDir,
|
||||
List classNames,
|
||||
Object rootDescriptor)
|
||||
throws IOException {
|
||||
File tempFile = File.createTempFile("idea_junit", ".tmp");
|
||||
tempFile.deleteOnExit();
|
||||
JUnitStarter.printClassesList(classNames, packageName + ", working directory: \'" + workingDir + "\'", "", tempFile);
|
||||
final OutputObjectRegistry registry = myTestRunner.getRegistry();
|
||||
final String startIndex = String.valueOf(registry != null ? registry.getKnownObject(rootDescriptor) : -1);
|
||||
final List childArgs = new ArrayList();
|
||||
childArgs.add(startIndex);
|
||||
childArgs.add("@" + tempFile.getAbsolutePath());
|
||||
childArgs.addAll(newArgs);
|
||||
return childArgs;
|
||||
}
|
||||
|
||||
|
||||
protected List getChildren(Object child) {
|
||||
return myTestRunner.getChildTests(child);
|
||||
}
|
||||
|
||||
protected PrintStream wrapOutputStream(OutputStream out) {
|
||||
return JUnitStarter.SM_RUNNER ? ((PrintStream)out) : ((SegmentedOutputStream)out).getPrintStream();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +224,10 @@ public class JUnitStarter {
|
||||
final List newArgs = new ArrayList();
|
||||
newArgs.add(String.valueOf(isJUnit4));
|
||||
newArgs.addAll(listeners);
|
||||
return new JUnitForkedStarter().startForkedVM(ourWorkingDirs, args, name, out, err, ourForkMode, ourCommandFileName, newArgs);
|
||||
PrintStream printOutputStream = SM_RUNNER ? ((PrintStream)out) : ((SegmentedOutputStream)out).getPrintStream();
|
||||
PrintStream printErrStream = SM_RUNNER ? ((PrintStream)err) : ((SegmentedOutputStream)err).getPrintStream();
|
||||
return new JUnitForkedSplitter(ourWorkingDirs, ourForkMode, printOutputStream, printErrStream, newArgs)
|
||||
.startSplitting(args, name, ourCommandFileName);
|
||||
}
|
||||
}
|
||||
testRunner.setStreams(out, err, 0);
|
||||
|
||||
+2
-2
@@ -40,7 +40,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.rt.execution.junit.ForkedDebuggerStarter;
|
||||
import com.intellij.rt.execution.testFrameworks.ForkedDebuggerHelper;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.net.NetUtils;
|
||||
import com.theoryinpractice.testng.model.*;
|
||||
@@ -311,7 +311,7 @@ public class TestNGRunnableState extends JavaTestFrameworkRunnableState<TestNGCo
|
||||
protected void passForkMode(String forkMode, File tempFile, JavaParameters parameters) throws ExecutionException {
|
||||
parameters.getProgramParametersList().add("@@@" + tempFile.getAbsolutePath());
|
||||
if (getForkSocket() != null) {
|
||||
parameters.getProgramParametersList().add(ForkedDebuggerStarter.DEBUG_SOCKET + getForkSocket().getLocalPort());
|
||||
parameters.getProgramParametersList().add(ForkedDebuggerHelper.DEBUG_SOCKET + getForkSocket().getLocalPort());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,8 +109,8 @@ public class RemoteTestNGStarter {
|
||||
if (SM_RUNNER) {
|
||||
if (commandFileName != null) {
|
||||
if (workingDirs != null && new File(workingDirs).length() > 0) {
|
||||
System.exit(new TestNGForkedStarter()
|
||||
.startForkedVM(workingDirs, args, param, System.out, System.err, "none", commandFileName, newArgs));
|
||||
System.exit(new TestNGForkedSplitter(workingDirs, System.out, System.err, newArgs)
|
||||
.startSplitting(args, param, commandFileName));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* 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 org.testng;
|
||||
|
||||
import com.intellij.rt.execution.testFrameworks.ForkedByModuleSplitter;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintStream;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class TestNGForkedSplitter extends ForkedByModuleSplitter {
|
||||
|
||||
|
||||
public TestNGForkedSplitter(String workingDirsPath, PrintStream out, PrintStream err, List newArgs) {
|
||||
super(workingDirsPath, "none", out, err, newArgs);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getStarterName() {
|
||||
return TestNGForkedStarter.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int startSplitting(String[] args,
|
||||
String configName) throws Exception {
|
||||
return splitPerModule();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int startPerModuleFork(String moduleName,
|
||||
List classNames,
|
||||
String packageName,
|
||||
String workingDir,
|
||||
String classpath,
|
||||
int result) throws Exception {
|
||||
final LinkedHashMap<String, Map<String, List<String>>> classes = new LinkedHashMap<String, Map<String, List<String>>>();
|
||||
for (Object className : classNames) {
|
||||
classes.put((String)className, null);
|
||||
}
|
||||
|
||||
String rootPath = null;
|
||||
if (!myNewArgs.isEmpty()) {
|
||||
rootPath = new File((String)myNewArgs.get(0)).getParent();
|
||||
}
|
||||
|
||||
final File file =
|
||||
TestNGXmlSuiteHelper.writeSuite(classes, new LinkedHashMap<String, String>(), moduleName, rootPath, TestNGXmlSuiteHelper.Logger.DEAF);
|
||||
file.deleteOnExit();
|
||||
|
||||
return Math.min(result, startChildFork(Collections.singletonList(file.getAbsolutePath()), new File(workingDir), classpath));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -16,49 +16,17 @@
|
||||
package org.testng;
|
||||
|
||||
import com.beust.jcommander.JCommander;
|
||||
import com.intellij.rt.execution.junit.ForkedStarter;
|
||||
import com.intellij.rt.execution.testFrameworks.ChildVMStarter;
|
||||
import org.testng.remote.RemoteArgs;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
import java.util.*;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class TestNGForkedStarter extends ForkedStarter {
|
||||
public class TestNGForkedStarter extends ChildVMStarter {
|
||||
public static void main(String[] args) throws Exception {
|
||||
new TestNGForkedStarter().startVM(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getStarterName() {
|
||||
return TestNGForkedStarter.class.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List createChildArgsForClasses(List newArgs,
|
||||
String moduleName,
|
||||
String packageName,
|
||||
String workingDir,
|
||||
List classNames,
|
||||
Object rootDescriptor) throws IOException {
|
||||
final LinkedHashMap<String, Map<String, List<String>>> classes = new LinkedHashMap<String, Map<String, List<String>>>();
|
||||
for (Object className : classNames) {
|
||||
classes.put((String)className, null);
|
||||
}
|
||||
|
||||
String rootPath = null;
|
||||
if (!newArgs.isEmpty()) {
|
||||
rootPath = new File((String)newArgs.get(0)).getParent();
|
||||
}
|
||||
|
||||
final File file =
|
||||
TestNGXmlSuiteHelper.writeSuite(classes, new LinkedHashMap<String, String>(), moduleName, rootPath,
|
||||
TestNGXmlSuiteHelper.Logger.DEAF);
|
||||
file.deleteOnExit();
|
||||
|
||||
return Collections.singletonList(file.getAbsolutePath());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void configureFrameworkAndRun(String[] args, PrintStream out, PrintStream err) throws Exception {
|
||||
final IDEARemoteTestNG testNG = new IDEARemoteTestNG(null);
|
||||
@@ -71,32 +39,4 @@ public class TestNGForkedStarter extends ForkedStarter {
|
||||
testNG.run();
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
//--------------------- fork under class level -------------------------------------
|
||||
|
||||
@Override
|
||||
protected List getChildren(Object child) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List createChildArgs(List args, Object child) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object findByClassName(String className, Object rootDescription) {
|
||||
return rootDescription;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTestClassName(Object child) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createRootDescription(String[] args, List newArgs, String configName, Object out, Object err) throws Exception {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user