Skip to content

Commit 6a69bd0

Browse files
committed
Fix EditorSwitchTest opening external terminals
Replace the usage of ".java" extension with a custom ".perf_text" extension in performance tests. The use of ".java" caused the OS to open external editors/terminals in environments where JDT is not installed or configured as the default editor. This change ensures that an internal test editor is used, keeping the tests self-contained and preventing external side effects.
1 parent ed45ed2 commit 6a69bd0

File tree

5 files changed

+14
-7
lines changed

5 files changed

+14
-7
lines changed

tests/org.eclipse.ui.tests.performance/plugin.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
name="Editor w/Outline"
2020
id="org.eclipse.ui.tests.perf_outline"
2121
extensions="perf_outline"/>
22+
<editor
23+
icon="icons/anything.gif"
24+
class="org.eclipse.ui.tests.performance.parts.PerformanceEditorPart"
25+
default="true"
26+
name="Basic Performance Editor 2"
27+
id="org.eclipse.ui.tests.perf_basic2"
28+
extensions="perf_text"/>
2229
</extension>
2330
<extension
2431
point="org.eclipse.ui.perspectives">

tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/EditorSwitchTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class EditorSwitchTest extends PerformanceTestCaseJunit4 {
5454

5555
@Parameters(name = "{index}: {0} - {1}")
5656
public static Collection<Object[]> data() {
57-
return Arrays.asList(new Object[][] { { "perf_outline", "java" }, { "perf_basic", "perf_outline" } });
57+
return Arrays.asList(new Object[][] { { "perf_outline", "perf_text" }, { "perf_basic", "perf_outline" } });
5858
}
5959

6060
/**

tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenCloseEditorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public class OpenCloseEditorTest extends PerformanceTestCaseJunit4 {
5252

5353
@Parameters(name = "{index}: {0}")
5454
public static Collection<Object[]> data() {
55-
return Arrays.asList(new Object[][] { { "perf_basic" }, { "perf_outline" }, { "java" } });
55+
return Arrays.asList(new Object[][] { { "perf_basic" }, { "perf_outline" }, { "perf_text" } });
5656
}
5757

5858

@@ -85,7 +85,7 @@ public void test() throws Throwable {
8585
stopMeasuring();
8686
});
8787

88-
if (extension.equals("java")) {
88+
if (extension.equals("perf_text")) {
8989
tagAsSummary("UI - Open/Close Editor", Dimension.ELAPSED_PROCESS);
9090
}
9191
commitMeasurements();

tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/OpenMultipleEditorTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ public class OpenMultipleEditorTest extends PerformanceTestCaseJunit4 {
5252

5353
@Parameters(name = "{index}: closeAll: {0} - closeEach: {1}")
5454
public static Collection<Object[]> data() {
55-
return Arrays.asList(new Object[][] { { "perf_basic", true }, { "perf_outline", true }, { "java", true },
56-
{ "perf_basic", false }, { "perf_outline", false }, { "java", false } });
55+
return Arrays.asList(new Object[][] { { "perf_basic", true }, { "perf_outline", true }, { "perf_text", true },
56+
{ "perf_basic", false }, { "perf_outline", false }, { "perf_text", false } });
5757
}
5858

5959
public OpenMultipleEditorTest(String extension, boolean closeAll) {

tests/org.eclipse.ui.tests.performance/src/org/eclipse/ui/tests/performance/UIPerformanceTestRule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class UIPerformanceTestRule extends ExternalResource {
3232
public static final String PROJECT_NAME = "Performance Project";
3333

3434
private static final String INTRO_VIEW = "org.eclipse.ui.internal.introview";
35-
public static final String[] EDITOR_FILE_EXTENSIONS = { "perf_basic", "perf_outline", "java" };
35+
public static final String[] EDITOR_FILE_EXTENSIONS = { "perf_basic", "perf_outline", "perf_text" };
3636

3737
@Override
3838
protected void before() throws Throwable {
@@ -67,7 +67,7 @@ public static IProject getTestProject() {
6767
}
6868

6969
private static void setUpProject() throws CoreException {
70-
// Create a java project.
70+
// Create a performance project.
7171
IProject testProject = getTestProject();
7272
testProject.create(null);
7373
testProject.open(null);

0 commit comments

Comments
 (0)