Added some more JUnit tests
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng.ui.tests / src / org / eclipse / linuxtools / lttng / ui / tests / control / model / component / TraceControlTestFacility.java
index 9dc19ae41e3e3f74448274844d00a100bddb049c..45331790bf5696da72ee7c0bf8559003d33024c0 100644 (file)
  *******************************************************************************/
 package org.eclipse.linuxtools.lttng.ui.tests.control.model.component;
 
+import org.eclipse.core.commands.Command;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.NotEnabledException;
+import org.eclipse.core.commands.NotHandledException;
+import org.eclipse.core.commands.common.NotDefinedException;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.linuxtools.lttng.ui.views.control.ControlView;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.IViewPart;
 import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.handlers.IHandlerService;
 
 /**
  *  Singleton class to facilitate the test cases. Creates UML2SD view and loader objects as well as provides
@@ -31,6 +38,8 @@ public class TraceControlTestFacility {
     final static public int WAIT_FOR_JOBS_DELAY = 1000; 
     final static public int GUI_REFESH_DELAY = 500;
     
+    final static public String COMMAND_CATEGORY_PREFIX = "org.eclipse.linuxtools.lttng.ui.commands.control."; //$NON-NLS-1$
+    
     // ------------------------------------------------------------------------
     // Attributes
     // ------------------------------------------------------------------------
@@ -124,4 +133,11 @@ public class TraceControlTestFacility {
     public ControlView getControlView() {
         return fControlView;
     }
+
+    public void executeCommand(String commandId) throws ExecutionException, NotDefinedException, NotEnabledException, NotHandledException {
+//        ICommandService commandService = (ICommandService) fControlView.getSite().getService(ICommandService.class);
+        IHandlerService handlerService = (IHandlerService) fControlView.getSite().getService(IHandlerService.class);
+        handlerService.executeCommand(COMMAND_CATEGORY_PREFIX + commandId, null);
+    }
+
 }
This page took 0.024553 seconds and 5 git commands to generate.