Skip to content

Commit 3de664a

Browse files
committed
Remove formatter parameter in EclipseTestRunner
The value was simply ignored and it was hiding the test-output parameter setting due to convoluted handling..
1 parent 0eab946 commit 3de664a

2 files changed

Lines changed: 16 additions & 22 deletions

File tree

eclipse.platform.releng/bundles/org.eclipse.test/src/org/eclipse/test/EclipseTestRunner.java

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2022 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -45,11 +45,9 @@
4545
import org.osgi.framework.FrameworkUtil;
4646

4747
/**
48-
* A TestRunner for JUnit that supports Ant JUnitResultFormatters and running
49-
* tests inside Eclipse. Example call: EclipseTestRunner -classname
50-
* junit.samples.SimpleTest
51-
* formatter=org.apache.tools.ant.taskdefs.optional.junit
52-
* .XMLJUnitResultFormatter
48+
* A TestRunner for JUnit that supports running tests inside Eclipse. Example
49+
* call: EclipseTestRunner -classname junit.samples.SimpleTest -resultPath
50+
* result.xml
5351
*/
5452
public class EclipseTestRunner {
5553

@@ -73,15 +71,13 @@ public class EclipseTestRunner {
7371
* <pre>
7472
* -className=&lt;testSuiteName&gt;
7573
* -testPluginName&lt;containingpluginName&gt;
76-
* -formatter=&lt;classname&gt;(,&lt;path&gt;)
74+
* -resultPath&lt;path&gt;
7775
* </pre>
7876
*
79-
* Where &lt;classname&gt; is the formatter classname, currently ignored as only
80-
* LegacyXmlResultFormatter is used. The path is either the path to the result
81-
* file and should include the file extension (xml) if a single test is being
82-
* run or should be the path to the result directory where result files should
83-
* be created if multiple tests are being run. If no path is given, the standard
84-
* output is used.
77+
* The result path is either the path to the result file and should include the
78+
* file extension (xml) if a single test is being run or should be the path to
79+
* the result directory where result files should be created if multiple tests
80+
* are being run. If no path is given, the standard output is used.
8581
*/
8682
public static void main(String[] args) throws IOException {
8783
System.exit(run(args));
@@ -133,10 +129,11 @@ public static int run(String[] args) throws IOException {
133129
junitReportOutput = args[i + 1];
134130
}
135131
i++;
136-
} else if (args[i].startsWith("formatter=")) {
137-
String formatterString = args[i].substring(10);
138-
int seperatorIndex = formatterString.indexOf(',');
139-
resultPathString = seperatorIndex == -1 ? null : formatterString.substring(seperatorIndex + 1);
132+
} else if (args[i].toLowerCase().equals("-resultpath")) {
133+
if (i < args.length - 1) {
134+
resultPathString = args[i + 1];
135+
}
136+
i++;
140137
} else if (args[i].startsWith("propsfile=")) {
141138
try (FileInputStream in = new FileInputStream(args[i].substring(10))) {
142139
props.load(in);

sites/eclipse-junit-tests/src/main/scripts/library.xml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@
135135
<property
136136
name="launchTarget"
137137
value="java-test" />
138-
<property
139-
name="formatter"
140-
value="org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter" />
141138

142139
<tstamp prefix="NOW" />
143140
<property file="${basedir}/finalPluginsVersions.properties" />
@@ -255,7 +252,7 @@
255252
</classpath>
256253
<arg line="-application ${application}" />
257254
<arg line="-data ${data-dir}" />
258-
<arg line="formatter=${formatter},${test-output}" />
255+
<arg line="-resultPath ${test-output}" />
259256
<arg line="-testPluginName ${plugin-name}" />
260257
<arg line="-className ${classname}" />
261258
<arg line="-os ${os}" />
@@ -325,7 +322,7 @@
325322
<arg line="-data ${data-dir}" />
326323
<arg line="${test-vm}" />
327324
<arg line="-application ${application}" />
328-
<arg line="formatter=${formatter},${test-output}" />
325+
<arg line="-resultPath ${test-output}" />
329326
<arg line="-testPluginName ${plugin-name}" />
330327
<arg line="-className ${classname}" />
331328
<arg line="-nosplash" />

0 commit comments

Comments
 (0)