Skip to content

Commit 0a53aa4

Browse files
committed
Migration of org.eclipse.e4.ui.bindings.tests to JUnit5
WIP
1 parent 4fbedad commit 0a53aa4

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

tests/org.eclipse.e4.ui.bindings.tests/META-INF/MANIFEST.MF

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Import-Package: org.eclipse.e4.core.commands,
88
org.eclipse.e4.ui.services,
99
org.eclipse.jface.bindings,
1010
org.eclipse.jface.bindings.keys,
11+
org.junit.jupiter.api;version="[5.12.0,6.0.0)",
12+
org.junit.jupiter.migrationsupport;version="[5.12.0,6.0.0)",
13+
org.junit.platform.suite.api;version="[1.12.0,2.0.0)",
1114
org.osgi.framework;version="1.5.0"
1215
Require-Bundle: org.eclipse.core.commands;bundle-version="3.12.400",
1316
org.junit,

tests/org.eclipse.e4.ui.bindings.tests/src/org/eclipse/e4/ui/bindings/tests/BindingTableTests.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
*******************************************************************************/
1616
package org.eclipse.e4.ui.bindings.tests;
1717

18-
import static org.junit.Assert.assertEquals;
19-
import static org.junit.Assert.assertFalse;
20-
import static org.junit.Assert.assertNotEquals;
21-
import static org.junit.Assert.assertNotNull;
22-
import static org.junit.Assert.assertTrue;
18+
import static org.junit.jupiter.api.Assertions.assertEquals;
19+
import static org.junit.jupiter.api.Assertions.assertFalse;
20+
import static org.junit.jupiter.api.Assertions.assertNotEquals;
21+
import static org.junit.jupiter.api.Assertions.assertNotNull;
22+
import static org.junit.jupiter.api.Assertions.assertTrue;
2323

2424
import java.util.ArrayList;
2525
import java.util.Collection;
@@ -41,8 +41,8 @@
4141
import org.eclipse.jface.bindings.Binding;
4242
import org.eclipse.jface.bindings.keys.KeyBinding;
4343
import org.eclipse.jface.bindings.keys.KeySequence;
44-
import org.junit.Before;
45-
import org.junit.Test;
44+
import org.junit.jupiter.api.BeforeEach;
45+
import org.junit.jupiter.api.Test;
4646

4747
@SuppressWarnings("restriction")
4848
public class BindingTableTests {
@@ -93,7 +93,7 @@ public class BindingTableTests {
9393
static IEclipseContext workbenchContext;
9494
private MApplication application;
9595

96-
@Before
96+
@BeforeEach
9797
public void setUp() throws Exception {
9898
IEclipseContext globalContext = TestUtil.getGlobalContext();
9999
workbenchContext = globalContext.createChild("workbenchContext");
@@ -389,7 +389,7 @@ private Binding getTestBinding(String commandId) {
389389

390390
private void assertContextSet(ContextSet set, String[] contextIds) {
391391
List<Context> contexts = set.getContexts();
392-
assertEquals(contexts.toString(), contextIds.length, contexts.size());
392+
assertEquals(contextIds.length, contexts.size(), contexts.toString());
393393
for (int i = 0; i < contextIds.length; i++) {
394394
assertEquals(contextIds[i], contexts.get(i).getId());
395395
}

tests/org.eclipse.e4.ui.bindings.tests/src/org/eclipse/e4/ui/bindings/tests/BindingTestSuite.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,15 @@
1414
*******************************************************************************/
1515
package org.eclipse.e4.ui.bindings.tests;
1616

17-
import org.junit.runner.RunWith;
18-
import org.junit.runners.Suite;
17+
import org.junit.platform.suite.api.SelectClasses;
18+
import org.junit.platform.suite.api.Suite;
1919

20-
@RunWith(Suite.class)
21-
@Suite.SuiteClasses({
20+
@Suite
21+
@SelectClasses({
2222
BindingLookupTest.class,
2323
KeyDispatcherTest.class,
2424
BindingTableTests.class,
2525
BindingCreateTest.class,
2626
KeyAssistDialogTest.class })
27-
2827
public class BindingTestSuite {
2928
}

0 commit comments

Comments
 (0)