From e763b0b0bb87007493c9d6ca958794377e001c99 Mon Sep 17 00:00:00 2001 From: "Klare, Heiko" Date: Tue, 30 Dec 2025 17:32:13 +0100 Subject: [PATCH] Remove JUnit 3 compatibility from PerformanceTestRunner The PerformanceTestRunner used to have different methods for executing performance tests. One of them accepts JUnit 3's TestCase. All consumers of that method have been replaced, such that the method can be removed. This also leads to unused parameters in internal methods that are removed by this change as well. Contributes to https://github.com/eclipse-platform/eclipse.platform/issues/903 --- .../tests/harness/PerformanceTestRunner.java | 32 ++----------------- 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/PerformanceTestRunner.java b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/PerformanceTestRunner.java index 0cc915f42dd..2be70bbc15a 100644 --- a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/PerformanceTestRunner.java +++ b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/harness/PerformanceTestRunner.java @@ -13,9 +13,6 @@ *******************************************************************************/ package org.eclipse.core.tests.harness; -import static org.junit.Assert.fail; - -import junit.framework.TestCase; import org.eclipse.test.performance.Dimension; import org.eclipse.test.performance.Performance; import org.eclipse.test.performance.PerformanceMeter; @@ -38,28 +35,6 @@ public void setRegressionReason(String comment) { */ protected abstract void test() throws Exception; - /** - * Executes the performance test the given number of times. Use the outer time - * to execute the test several times in order to obtain a normalized average. Use - * the inner loop for very fast tests that would otherwise be difficult to measure - * due to Java's poor timer granularity. The inner loop is not needed for long - * tests that typically take more than a second to execute. - * - * @param testCase The test that is running (used to obtain an appropriate meter) - * @param localName the short name used to tag the local test - * @param outer The number of repetitions of the test. - * @param inner The number of repetitions within the performance timer. - */ - public final void run(TestCase testCase, String localName, int outer, int inner) { - Performance perf = Performance.getDefault(); - PerformanceMeter meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(testCase)); - try { - runTest(meter, localName, outer, inner); - } catch (Exception e) { - fail("Failed performance test with exception:" + e); - } - } - /** * Executes the performance test the given number of times. Use the outer time * to execute the test several times in order to obtain a normalized average. @@ -78,10 +53,10 @@ public final void run(TestCase testCase, String localName, int outer, int inner) public final void run(Class testClass, String testMethodName, int outer, int inner) throws Exception { Performance perf = Performance.getDefault(); PerformanceMeter meter = perf.createPerformanceMeter(perf.getDefaultScenarioId(testClass, testMethodName)); - runTest(meter, null, outer, inner); + runTest(meter, outer, inner); } - private void runTest(PerformanceMeter meter, String localName, int outer, int inner) throws Exception { + private void runTest(PerformanceMeter meter, int outer, int inner) throws Exception { Performance perf = Performance.getDefault(); if (regressionReason != null) { perf.setComment(meter, Performance.EXPLAINS_DEGRADATION_COMMENT, regressionReason); @@ -96,9 +71,6 @@ private void runTest(PerformanceMeter meter, String localName, int outer, int in meter.stop(); tearDown(); } - if (localName != null) { - perf.tagAsSummary(meter, localName, Dimension.ELAPSED_PROCESS); - } if (fingerprintName != null) { perf.tagAsSummary(meter, fingerprintName, Dimension.ELAPSED_PROCESS); }