15
15
*******************************************************************************/
16
16
package org .eclipse .e4 .core .commands .tests ;
17
17
18
- import static org .junit .Assert .assertEquals ;
19
- import static org .junit .Assert .assertNotNull ;
18
+ import static org .junit .jupiter . api . Assertions .assertEquals ;
19
+ import static org .junit .jupiter . api . Assertions .assertNotNull ;
20
20
21
21
import java .util .HashMap ;
22
22
import java .util .Map ;
32
32
import org .eclipse .e4 .core .contexts .ContextInjectionFactory ;
33
33
import org .eclipse .e4 .core .contexts .EclipseContextFactory ;
34
34
import org .eclipse .e4 .core .contexts .IEclipseContext ;
35
- import org .junit .After ;
36
- import org .junit .Before ;
37
- import org .junit .Test ;
35
+ import org .junit .jupiter . api . AfterEach ;
36
+ import org .junit .jupiter . api . BeforeEach ;
37
+ import org .junit .jupiter . api . Test ;
38
38
import org .osgi .framework .FrameworkUtil ;
39
39
40
40
public class DefineCommandsTest {
@@ -46,15 +46,15 @@ public class DefineCommandsTest {
46
46
47
47
private IEclipseContext workbenchContext ;
48
48
49
- @ Before
49
+ @ BeforeEach
50
50
public void setUp () {
51
51
IEclipseContext serviceContext = EclipseContextFactory .getServiceContext (FrameworkUtil .getBundle (this .getClass ()).getBundleContext ());
52
52
IEclipseContext globalContext = serviceContext .createChild ();
53
53
workbenchContext = globalContext .createChild ("workbenchContext" );
54
54
ContextInjectionFactory .make (CommandServiceAddon .class , workbenchContext );
55
55
}
56
56
57
- @ After
57
+ @ AfterEach
58
58
public void tearDown () {
59
59
workbenchContext .dispose ();
60
60
}
@@ -65,14 +65,14 @@ public void testCreateCommands() throws NotDefinedException {
65
65
assertNotNull (cs );
66
66
assertNotNull (cs .defineCategory (TEST_CAT1 , "CAT1" , null ));
67
67
Category category = cs .getCategory (TEST_CAT1 );
68
- assertNotNull ("need category" , category );
69
- assertNotNull ("command1" , cs .defineCommand (TEST_ID1 , "ID1" , null , category , null ));
70
- assertNotNull ("command2" , cs .defineCommand (TEST_ID2 , "ID2" , null , category , null ));
68
+ assertNotNull (category , "need category" );
69
+ assertNotNull (cs .defineCommand (TEST_ID1 , "ID1" , null , category , null ), "command1" );
70
+ assertNotNull (cs .defineCommand (TEST_ID2 , "ID2" , null , category , null ), "command2" );
71
71
Command cmd1 = cs .getCommand (TEST_ID1 );
72
- assertNotNull ("get command1" , cmd1 );
72
+ assertNotNull (cmd1 , "get command1" );
73
73
assertEquals ("ID1" , cmd1 .getName ());
74
- assertNotNull ("get command2" , cs .getCommand (TEST_ID2 ));
75
- assertNotNull ("parameterized command" , cs .createCommand (TEST_ID1 , null ));
74
+ assertNotNull (cs .getCommand (TEST_ID2 ), "get command2" );
75
+ assertNotNull (cs .createCommand (TEST_ID1 , null ), "parameterized command" );
76
76
}
77
77
78
78
@ Test
@@ -110,7 +110,7 @@ public boolean isOptional() {
110
110
assertNotNull (command );
111
111
assertNotNull (createdParamizedCommand );
112
112
Command cmd1 = cs .getCommand (TEST_ID1_WITH_PARAMETERS );
113
- assertNotNull ("get command1" , cmd1 );
113
+ assertNotNull (cmd1 , "get command1" );
114
114
}
115
115
116
116
@@ -123,14 +123,14 @@ public void testCreateWithSecondContexts() throws NotDefinedException {
123
123
assertNotNull (cs );
124
124
assertNotNull (cs .defineCategory (TEST_CAT1 , "CAT1" , null ));
125
125
Category category = cs .getCategory (TEST_CAT1 );
126
- assertNotNull ("need category" , category );
127
- assertNotNull ("command1" , cs .defineCommand (TEST_ID1 , "ID1" , null , category , null ));
128
- assertNotNull ("command2" , cs .defineCommand (TEST_ID2 , "ID2" , null , category , null ));
126
+ assertNotNull (category , "need category" );
127
+ assertNotNull (cs .defineCommand (TEST_ID1 , "ID1" , null , category , null ), "command1" );
128
+ assertNotNull (cs .defineCommand (TEST_ID2 , "ID2" , null , category , null ), "command2" );
129
129
130
130
Command cmd1 = cs .getCommand (TEST_ID1 );
131
- assertNotNull ("get command1" , cmd1 );
131
+ assertNotNull (cmd1 , "get command1" );
132
132
assertEquals ("ID1" , cmd1 .getName ());
133
- assertNotNull ("get command2" , cs .getCommand (TEST_ID2 ));
133
+ assertNotNull (cs .getCommand (TEST_ID2 ), "get command2" );
134
134
}
135
135
136
136
@ Test
@@ -140,14 +140,14 @@ public void testCreateWithTwoContexts() throws NotDefinedException {
140
140
assertNotNull (cs );
141
141
assertNotNull (cs .defineCategory (TEST_CAT1 , "CAT1" , null ));
142
142
Category category = cs .getCategory (TEST_CAT1 );
143
- assertNotNull ("need category" , category );
144
- assertNotNull ("command1" , cs .defineCommand (TEST_ID1 , "ID1" , null , category , null ));
145
- assertNotNull ("command2" , cs .defineCommand (TEST_ID2 , "ID2" , null , category , null ));
143
+ assertNotNull (category , "need category" );
144
+ assertNotNull (cs .defineCommand (TEST_ID1 , "ID1" , null , category , null ), "command1" );
145
+ assertNotNull (cs .defineCommand (TEST_ID2 , "ID2" , null , category , null ), "command2" );
146
146
147
147
cs = workbenchContext .get (ECommandService .class );
148
148
Command cmd1 = cs .getCommand (TEST_ID1 );
149
- assertNotNull ("get command1" , cmd1 );
149
+ assertNotNull (cmd1 , "get command1" );
150
150
assertEquals ("ID1" , cmd1 .getName ());
151
- assertNotNull ("get command2" , cs .getCommand (TEST_ID2 ));
151
+ assertNotNull (cs .getCommand (TEST_ID2 ), "get command2" );
152
152
}
153
153
}
0 commit comments