Skip to content

Commit a9a50ff

Browse files
committed
Remove unused JUnit Rule and TestName imports
This commit removes unused JUnit TestName rule imports and field declarations from three test classes: - PartRenderingEngineTests.java - TestUnitRegistrationWindows.java - TextEditorPluginTest.java The TestName fields were declared but never used in the test methods. This cleanup also removes debug println statements that were left in TestUnitRegistrationWindows.java. Fixes: #3451
1 parent 9c171a0 commit a9a50ff

File tree

3 files changed

+0
-16
lines changed

3 files changed

+0
-16
lines changed

tests/org.eclipse.e4.ui.tests/src/org/eclipse/e4/ui/tests/workbench/PartRenderingEngineTests.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
import org.junit.Ignore;
7272
import org.junit.Rule;
7373
import org.junit.Test;
74-
import org.junit.rules.TestName;
7574
import org.junit.rules.TestWatcher;
7675
import org.osgi.service.log.LogLevel;
7776
import org.osgi.service.log.LogListener;
@@ -99,9 +98,6 @@ public class PartRenderingEngineTests {
9998
private boolean logged = false;
10099
private Consumer<RuntimeException> runtimeExceptionHandler;
101100

102-
@Rule
103-
public TestName testName = new TestName();
104-
105101
@Before
106102
public void setUp() {
107103
logged = false;

tests/org.eclipse.tests.urischeme/src/org/eclipse/urischeme/internal/registration/TestUnitRegistrationWindows.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,10 @@
2626
import org.junit.AfterClass;
2727
import org.junit.Before;
2828
import org.junit.BeforeClass;
29-
import org.junit.Rule;
3029
import org.junit.Test;
31-
import org.junit.rules.TestName;
3230

3331
public class TestUnitRegistrationWindows {
3432

35-
@Rule
36-
public TestName name = new TestName();
37-
3833
private static final String PATH_TO_OTHER_APPLICATION_EXE = "c:\\path\\to\\otherApplication.exe";
3934
private static final String PATH_TO_ECLIPSE_EXE = "c:\\path\\with spaces\\to\\eclipse\\Eclipse.exe";
4035
private static final String PATH_TO_ECLIPSE_HOME = "c:\\path\\with spaces\\to\\eclipse";
@@ -161,15 +156,13 @@ public void getLauncherPathFromLauncherProperty() throws Exception {
161156

162157
@Test
163158
public void getLauncherPathFromEclipseHomeProperty() throws Exception {
164-
System.out.println("registrationWindows1: " + registrationWindows);
165159
System.clearProperty("eclipse.launcher");
166160
System.setProperty("eclipse.home.location", URL_TO_ECLIPSE_HOME);
167161
fileProvider.fileExistsAnswers.put(PATH_TO_ECLIPSE_HOME, true);
168162
fileProvider.isDirectoryAnswers.put(PATH_TO_ECLIPSE_HOME, true);
169163
fileProvider.newDirectoryStreamAnswers.computeIfAbsent(PATH_TO_ECLIPSE_HOME, path -> new HashMap<>())
170164
.put("*.exe", Arrays.asList(PATH_TO_ECLIPSE_HOME + "\\Eclipse.exe"));
171165

172-
System.out.println("registrationWindows2: " + registrationWindows);
173166
assertEquals(PATH_TO_ECLIPSE_EXE, registrationWindows.getEclipseLauncher());
174167
}
175168

tests/org.eclipse.ui.workbench.texteditor.tests/src/org/eclipse/ui/workbench/texteditor/tests/TextEditorPluginTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
import java.util.Random;
2222

2323
import org.junit.FixMethodOrder;
24-
import org.junit.Rule;
2524
import org.junit.Test;
26-
import org.junit.rules.TestName;
2725
import org.junit.runners.MethodSorters;
2826

2927
import org.eclipse.ui.internal.texteditor.HistoryTracker;
@@ -36,9 +34,6 @@
3634
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
3735
public class TextEditorPluginTest {
3836

39-
@Rule
40-
public TestName testName = new TestName();
41-
4237
Random rand = new Random(55); //pseudo-random for repeatability
4338

4439
@Test

0 commit comments

Comments
 (0)