control: command support for enabling all tracepoints/syscalls
[deliverable/tracecompass.git] / lttng / org.eclipse.tracecompass.lttng2.control.ui.tests / src / org / eclipse / tracecompass / lttng2 / control / ui / tests / service / LTTngControlServiceTest.java
index d7cfcdc55bbd18882cfe86ae5d6fa0971da7e139..8618b25e30aea6f4a652053743800b01cdf21a69 100644 (file)
@@ -58,6 +58,7 @@ import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngCo
 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.service.LTTngControlServiceFactory;
 import org.junit.After;
 import org.junit.Before;
+import org.junit.Ignore;
 import org.junit.Test;
 import org.osgi.framework.FrameworkUtil;
 
@@ -72,11 +73,11 @@ public class LTTngControlServiceTest {
     private static final String TEST_STREAM = "LTTngServiceTest.cfg";
 
     private static final String SCEN_LTTNG_NOT_INSTALLED = "LttngNotInstalled";
-    private static final String SCEN_LTTNG_VERSION = "LttngVersion";
-    private static final String SCEN_LTTNG_VERSION_WITH_PROMPT = "LttngVersionWithPrompt";
+    protected static final String SCEN_LTTNG_VERSION = "LttngVersion";
+    protected static final String SCEN_LTTNG_VERSION_WITH_PROMPT = "LttngVersionWithPrompt";
     private static final String SCEN_LTTNG_UNSUPPORTED_VERSION = "LttngUnsupportedVersion";
     private static final String SCEN_LTTNG_NO_VERSION = "LttngNoVersion";
-    private static final String SCEN_LTTNG_COMPILED_VERSION = "LttngVersionCompiled";
+    protected static final String SCEN_LTTNG_COMPILED_VERSION = "LttngVersionCompiled";
     private static final String SCEN_NO_SESSION_AVAILABLE = "NoSessionAvailable";
     private static final String SCEN_GET_SESSION_NAMES1 = "GetSessionNames1";
     private static final String SCEN_GET_SESSION_WITH_GROUP = "GetSessionWithTracingGroup";
@@ -105,7 +106,6 @@ public class LTTngControlServiceTest {
     private static final String SCEN_EVENT_HANDLING = "EventHandling";
     private static final String SCEN_CONTEXT_HANDLING = "ContextHandling";
     private static final String SCEN_CONTEXT_ERROR_HANDLING = "ContextErrorHandling";
-    private static final String SCEN_CALIBRATE_HANDLING = "CalibrateHandling";
     private static final String SCEN_CREATE_SESSION_2_1 = "CreateSessionLttng2.1";
     private static final String SCEN_CREATE_SESSION_VERBOSE_2_1 = "CreateSessionLttngVerbose2.1";
     private static final String SCEN_CREATE_SNAPSHOT_SESSION = "CreateSessionSnapshot";
@@ -114,6 +114,8 @@ public class LTTngControlServiceTest {
     private static final String SCEN_CREATE_SNAPSHOT_SESSION_ERRORS = "CreateSessionSnapshotErrors";
     protected static final String SCEN_CREATE_LIVE_SESSION = "CreateSessionLive";
     private static final String SCEN_CREATE_LIVE_SESSION_ERRORS = "CreateSessionLiveErrors";
+    private static final String SCEN_SESSION_PROFILES = "SessionProfile";
+
 
 
     // ------------------------------------------------------------------------
@@ -469,6 +471,7 @@ public class LTTngControlServiceTest {
     }
 
     @Test
+    @Ignore
     public void testGetSessionWithLive() {
         try {
             fShell.setScenario(SCEN_GET_SESSION_WITH_LIVE);
@@ -1116,7 +1119,8 @@ public class LTTngControlServiceTest {
             list.clear();
             fService.enableEvents(sessionName, channelName, list, false, null, new NullProgressMonitor());
 
-            // TODO add test with filters
+            // 6) session name, channel = null,
+            fService.enableEvents(sessionName, null, ILttngControlService.ALL_EVENTS, true, null, new NullProgressMonitor());
 
         } catch (ExecutionException e) {
             fail(e.toString());
@@ -1259,28 +1263,6 @@ public class LTTngControlServiceTest {
         }
     }
 
-    @Test
-    public void testCalibrate() {
-        try {
-            fShell.setScenario(SCEN_CALIBRATE_HANDLING);
-            fService.calibrate(true, new NullProgressMonitor());
-
-        } catch (ExecutionException e) {
-            fail(e.toString());
-        }
-    }
-
-    @Test
-    public void testCalibrateFailure() {
-        try {
-            fShell.setScenario(SCEN_CALIBRATE_HANDLING);
-            fService.calibrate(false, new NullProgressMonitor());
-            fail("No exeption generated");
-        } catch (ExecutionException e) {
-            // success
-        }
-    }
-
     @Test
     public void testCreateSession2_1() {
 
@@ -1526,6 +1508,7 @@ public class LTTngControlServiceTest {
     }
 
     @Test
+    @Ignore
     public void testCreateLiveSession() throws ExecutionException {
         fShell.setScenario(SCEN_CREATE_LIVE_SESSION);
 
@@ -1546,6 +1529,7 @@ public class LTTngControlServiceTest {
     }
 
     @Test
+    @Ignore
     public void testCreateLiveSessionErrors() {
         try {
             fShell.setScenario(SCEN_CREATE_LIVE_SESSION_ERRORS);
@@ -1580,6 +1564,48 @@ public class LTTngControlServiceTest {
         }
     }
 
+    @Test
+    public void testSessionProfile() {
+        fShell.setScenario(SCEN_SESSION_PROFILES);
+        final String profile = "/home/user/.lttng/sessions/mysession.lttng";
+        try {
+            fService.loadSession(profile, false, new NullProgressMonitor());
+        } catch (ExecutionException e) {
+            fail("load session failed: " + e);
+        }
+
+        try {
+            fService.loadSession(profile, true, new NullProgressMonitor());
+        } catch (ExecutionException e) {
+            fail("load session failed: " + e);
+        }
+
+        try {
+            fService.saveSession(null, null, false, new NullProgressMonitor());
+        } catch (ExecutionException e) {
+            fail("save session failed: " + e);
+        }
+
+        final String sessionName = "mysession";
+        try {
+            fService.saveSession(sessionName, null, false, new NullProgressMonitor());
+        } catch (ExecutionException e) {
+            fail("save session failed: " + e);
+        }
+
+        try {
+            fService.saveSession(sessionName, null, true, new NullProgressMonitor());
+        } catch (ExecutionException e) {
+            fail("save session failed: " + e);
+        }
+
+        try {
+            fService.saveSession(sessionName, "/tmp/test", true, new NullProgressMonitor());
+        } catch (ExecutionException e) {
+            fail("save session failed: " + e);
+        }
+    }
+
     private static void enableVerbose() {
         // verbose
         ControlCommandLogger.init(ControlPreferences.getInstance().getLogfilePath(), false);
This page took 0.026988 seconds and 5 git commands to generate.