control: command support for enabling all tracepoints/syscalls
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests / src / org / eclipse / tracecompass / lttng2 / control / ui / swtbot / tests / ControlViewSwtBotUtil.java
index 35786bda31f5e2fd46f58e846a3b2e34be5482a8..b5a40976f6b54fc39d696592df2d03d8bc3fc29b 100644 (file)
@@ -9,9 +9,12 @@
 
 package org.eclipse.tracecompass.lttng2.control.ui.swtbot.tests;
 
+import java.util.Arrays;
+
 import org.eclipse.swtbot.swt.finder.waits.ICondition;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.TargetNodeState;
 import org.eclipse.tracecompass.internal.lttng2.control.core.model.TraceSessionState;
+import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.ITraceControlComponent;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TargetNodeComponent;
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.model.impl.TraceSessionComponent;
 import org.eclipse.tracecompass.tmf.ui.swtbot.tests.shared.ConditionHelpers.SWTBotTestCondition;
@@ -28,8 +31,11 @@ class ControlViewSwtBotUtil {
     public static final String KERNEL_DOMAIN_NAME = "Kernel";
     public static final String UST_DOMAIN_NAME = "UST global";
     public static final String SESSION_GROUP_NAME = "Sessions";
+    public static final String PROVIDER_GROUP_NAME = "Provider";
     public static final String ALL_EVENTS_NAME = "*";
+    public static final String SCHED_SWITCH_EVENT_NAME = "sched_switch";
     public static final String PROFILE_SUFFIX = ".lttng";
+    public static final String KERNEL_TRACE_NAME = "kernel";
 
     // Menu strings
     public static final String CONNECT_MENU_ITEM = "Connect";
@@ -39,6 +45,7 @@ class ControlViewSwtBotUtil {
     public static final String ENABLE_EVENT_MENU_ITEM = "Enable Event...";
     public static final String START_MENU_ITEM = "Start";
     public static final String STOP_MENU_ITEM = "Stop";
+    public static final String IMPORT_MENU_ITEM = "Import...";
     public static final String DESTROY_MENU_ITEM = "Destroy Session...";
     public static final String DISCONNECT_MENU_ITEM = "Disconnect";
     public static final String SAVE_MENU_ITEM = "Save...";
@@ -51,6 +58,8 @@ class ControlViewSwtBotUtil {
     public static final String CONFIRM_DIALOG_OK_BUTTON = "OK";
     public static final String ENABLE_EVENT_DIALOG_TITLE = "Enable Events";
     public static final String ALL_TREE_NODE = "All";
+    public static final String ALL_EVENT_GROUP_NAME = "All Tracepoint Events and Syscalls";
+    public static final String TRACEPOINTS_GROUP_NAME = "Tracepoint Events";
     public static final String SYSCALL_GROUP_NAME = "All Syscalls";
     public static final String GROUP_SELECT_NAME = "Select";
     public static final String ENABLE_CHANNEL_DIALOG_TITLE = "Enable Channel";
@@ -58,6 +67,8 @@ class ControlViewSwtBotUtil {
     public static final String UST_GROUP_NAME = "UST";
     public static final String BUFFERTYPE_GROUP_NAME = "Buffer Type";
     public static final String BUFFERTYPE_PER_UID = "Per UID buffers";
+    public static final String FILTER_EXPRESSION_LABEL = "Filter Expression";
+    public static final String SESSION_LIST_GROUP_NAME = "Session List";
 
     public static final String DESTROY_CONFIRM_DIALOG_TITLE = "Destroy Confirmation";
     public static final String CHANNEL_NAME_LABEL = "Channel Name";
@@ -66,6 +77,13 @@ class ControlViewSwtBotUtil {
     public static final String LOAD_DIALOG_TITLE = "Load Sessions";
     public static final String REMOTE_RADIO_BUTTON_LABEL = "Remote";
 
+    // Remote import strings
+    public static final String IMPORT_WIZARD_TITLE = "Fetch Remote Traces";
+    public static final String DEFAULT_REMOTE_PROJECT = "Remote";
+    public static final String FINISH_BUTTON = "Finish";
+    public static final String CANCEL_BUTTON = "Cancel";
+    public static final String OPTION_GROUP_NAME = "Options";
+
     private ControlViewSwtBotUtil() { }
 
     /**
@@ -131,4 +149,27 @@ class ControlViewSwtBotUtil {
         return null;
     }
 
+    /**
+     * Finds a {@link ITraceControlComponent} in a tree for given path.
+     *
+     * @param root
+     *            root component
+     * @param path
+     *            path to element
+     * @return the matched component or null
+     */
+    public static ITraceControlComponent getComponent(ITraceControlComponent root, String... path) {
+        ITraceControlComponent newRoot = root;
+        for (String segment : path) {
+            newRoot = Arrays.asList(newRoot.getChildren()).stream()
+            .filter(child -> (child.getName().equals(segment)))
+            .findFirst()
+            .orElse(null);
+            if (newRoot == null) {
+                return null;
+            }
+        }
+        return newRoot;
+    }
+
 }
This page took 0.035998 seconds and 5 git commands to generate.