1515 *******************************************************************************/
1616package org .eclipse .e4 .core .commands .tests ;
1717
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 ;
2020
2121import java .util .HashMap ;
2222import java .util .Map ;
3232import org .eclipse .e4 .core .contexts .ContextInjectionFactory ;
3333import org .eclipse .e4 .core .contexts .EclipseContextFactory ;
3434import 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 ;
3838import org .osgi .framework .FrameworkUtil ;
3939
4040public class DefineCommandsTest {
@@ -46,15 +46,15 @@ public class DefineCommandsTest {
4646
4747 private IEclipseContext workbenchContext ;
4848
49- @ Before
49+ @ BeforeEach
5050 public void setUp () {
5151 IEclipseContext serviceContext = EclipseContextFactory .getServiceContext (FrameworkUtil .getBundle (this .getClass ()).getBundleContext ());
5252 IEclipseContext globalContext = serviceContext .createChild ();
5353 workbenchContext = globalContext .createChild ("workbenchContext" );
5454 ContextInjectionFactory .make (CommandServiceAddon .class , workbenchContext );
5555 }
5656
57- @ After
57+ @ AfterEach
5858 public void tearDown () {
5959 workbenchContext .dispose ();
6060 }
@@ -65,14 +65,14 @@ public void testCreateCommands() throws NotDefinedException {
6565 assertNotNull (cs );
6666 assertNotNull (cs .defineCategory (TEST_CAT1 , "CAT1" , null ));
6767 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" );
7171 Command cmd1 = cs .getCommand (TEST_ID1 );
72- assertNotNull ("get command1" , cmd1 );
72+ assertNotNull (cmd1 , "get command1" );
7373 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" );
7676 }
7777
7878 @ Test
@@ -110,7 +110,7 @@ public boolean isOptional() {
110110 assertNotNull (command );
111111 assertNotNull (createdParamizedCommand );
112112 Command cmd1 = cs .getCommand (TEST_ID1_WITH_PARAMETERS );
113- assertNotNull ("get command1" , cmd1 );
113+ assertNotNull (cmd1 , "get command1" );
114114 }
115115
116116
@@ -123,14 +123,14 @@ public void testCreateWithSecondContexts() throws NotDefinedException {
123123 assertNotNull (cs );
124124 assertNotNull (cs .defineCategory (TEST_CAT1 , "CAT1" , null ));
125125 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" );
129129
130130 Command cmd1 = cs .getCommand (TEST_ID1 );
131- assertNotNull ("get command1" , cmd1 );
131+ assertNotNull (cmd1 , "get command1" );
132132 assertEquals ("ID1" , cmd1 .getName ());
133- assertNotNull ("get command2" , cs .getCommand (TEST_ID2 ));
133+ assertNotNull (cs .getCommand (TEST_ID2 ), "get command2" );
134134 }
135135
136136 @ Test
@@ -140,14 +140,14 @@ public void testCreateWithTwoContexts() throws NotDefinedException {
140140 assertNotNull (cs );
141141 assertNotNull (cs .defineCategory (TEST_CAT1 , "CAT1" , null ));
142142 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" );
146146
147147 cs = workbenchContext .get (ECommandService .class );
148148 Command cmd1 = cs .getCommand (TEST_ID1 );
149- assertNotNull ("get command1" , cmd1 );
149+ assertNotNull (cmd1 , "get command1" );
150150 assertEquals ("ID1" , cmd1 .getName ());
151- assertNotNull ("get command2" , cs .getCommand (TEST_ID2 ));
151+ assertNotNull (cs .getCommand (TEST_ID2 ), "get command2" );
152152 }
153153}
0 commit comments