Skip to content

Commit 0c9c062

Browse files
committed
Migrate PluginWalkerTest from JUnit 4 to JUnit 5 in
org.eclipse.ui.tests.pluginchecks
1 parent 0ceaff5 commit 0c9c062

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

tests/org.eclipse.ui.tests.pluginchecks/META-INF/MANIFEST.MF

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ Bundle-SymbolicName: org.eclipse.ui.tests.pluginchecks;singleton:=true
55
Bundle-Version: 1.2.400.qualifier
66
Automatic-Module-Name: org.eclipse.ui.tests.pluginchecks
77
Bundle-RequiredExecutionEnvironment: JavaSE-17
8-
Require-Bundle: org.junit;bundle-version="4.12.0",
9-
org.eclipse.core.runtime;bundle-version="3.29.0",
8+
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.29.0",
109
org.eclipse.e4.ui.css.swt;bundle-version="0.13.200",
1110
org.eclipse.e4.ui.model.workbench;bundle-version="2.1.100",
1211
org.eclipse.e4.ui.workbench.swt;bundle-version="0.14.300",
@@ -28,4 +27,6 @@ Require-Bundle: org.junit;bundle-version="4.12.0",
2827
org.eclipse.ui.monitoring;bundle-version="1.1.300"
2928
Bundle-ActivationPolicy: lazy
3029
Bundle-Vendor: Eclipse.org
31-
Import-Package: org.eclipse.ui.internal
30+
Import-Package: org.eclipse.ui.internal,
31+
org.junit.jupiter.api;version="[5.14.0,6.0.0)",
32+
org.junit.jupiter.api.function;version="[5.14.0,6.0.0)"

tests/org.eclipse.ui.tests.pluginchecks/src/org/eclipse/ui/tests/pluginchecks/PluginWalkerTest.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414

1515
package org.eclipse.ui.tests.pluginchecks;
1616

17-
import static org.junit.Assert.assertNotNull;
18-
import static org.junit.Assert.assertTrue;
19-
import static org.junit.Assert.fail;
17+
import static org.junit.jupiter.api.Assertions.assertNotNull;
18+
import static org.junit.jupiter.api.Assertions.assertTrue;
19+
import static org.junit.jupiter.api.Assertions.fail;
2020

2121
import java.io.IOException;
2222
import java.io.InputStream;
@@ -37,8 +37,8 @@
3737
import org.eclipse.core.runtime.IExtensionPoint;
3838
import org.eclipse.core.runtime.IExtensionRegistry;
3939
import org.eclipse.core.runtime.RegistryFactory;
40-
import org.junit.Before;
41-
import org.junit.Test;
40+
import org.junit.jupiter.api.BeforeEach;
41+
import org.junit.jupiter.api.Test;
4242
import org.osgi.framework.Bundle;
4343
import org.osgi.framework.BundleContext;
4444
import org.osgi.framework.Constants;
@@ -66,10 +66,10 @@ public class PluginWalkerTest {
6666
private BundleContext bundleContext;
6767
private List<String> bundlesWithPluginXml;
6868

69-
@Before
69+
@BeforeEach
7070
public void setup() throws Exception {
7171
Bundle bundle = FrameworkUtil.getBundle(PluginWalkerTest.class);
72-
assertNotNull("Make sure you're running this as a plugin test", bundle);
72+
assertNotNull(bundle, "Make sure you're running this as a plugin test");
7373
assertNotNull(bundle);
7474
bundleContext = bundle.getBundleContext();
7575
bundlesWithPluginXml = List.of("org.eclipse.e4.ui.css.swt", "org.eclipse.e4.ui.model.workbench",
@@ -101,10 +101,8 @@ public void ensurePluginxmlContainsAtLeastOneEntry() throws Exception {
101101
boolean hasExtension = extensions.getLength() > 0;
102102
boolean hasExtensionPoint = extensionpoint.getLength() > 0;
103103

104-
assertTrue(
105-
"plugin.xml from " + bundleSymbolicName
106-
+ " must contain at least one extension point or extension",
107-
hasExtension || hasExtensionPoint);
104+
assertTrue(hasExtension || hasExtensionPoint, "plugin.xml from " + bundleSymbolicName
105+
+ " must contain at least one extension point or extension");
108106
}
109107

110108
}

0 commit comments

Comments
 (0)