lttng: update enable channel for UST buffer type
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui.tests / src / org / eclipse / linuxtools / lttng2 / ui / tests / control / service / LTTngControlServiceTest.java
index 1e00346bbbe57a9d0a29de44c54ab7183a137b6d..d4fd95a874420c12ce0e98747c19df1dc2064561 100644 (file)
@@ -41,6 +41,7 @@ import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEnablement
 import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceEventType;
 import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceLogLevel;
 import org.eclipse.linuxtools.internal.lttng2.core.control.model.TraceSessionState;
+import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.BufferType;
 import org.eclipse.linuxtools.internal.lttng2.core.control.model.impl.ChannelInfo;
 import org.eclipse.linuxtools.internal.lttng2.stubs.service.CommandShellFactory;
 import org.eclipse.linuxtools.internal.lttng2.stubs.shells.LTTngToolsFileShell;
@@ -813,7 +814,7 @@ public class LTTngControlServiceTest {
     @Test
     public void testCreateChannel() {
         try {
-
+            ((LTTngControlService)fService).setVersion("2.2.0");
             String sessionName = "mysession2";
             List<String> list = new ArrayList<String>();
             String kernelChannel0 = "mychannel0";
@@ -847,6 +848,7 @@ public class LTTngControlServiceTest {
             chanInfo.setMaxNumberTraceFiles(20);
             chanInfo.setMaxSizeTraceFiles(0);
             fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
+            ((LTTngControlService)fService).setVersion("2.0.0");
 
         } catch (ExecutionException e) {
             fail(e.toString());
@@ -856,6 +858,7 @@ public class LTTngControlServiceTest {
     @Test
     public void testCreateChannelUIDBuffer() {
         try {
+            ((LTTngControlService)fService).setVersion("2.2.0");
             String sessionName = "mysession2";
             List<String> list = new ArrayList<String>();
             String USTChannel = "ustChannel";
@@ -870,8 +873,38 @@ public class LTTngControlServiceTest {
             chanInfo.setNumberOfSubBuffers(1);
             chanInfo.setMaxNumberTraceFiles(20);
             chanInfo.setMaxSizeTraceFiles(0);
-            chanInfo.setBuffersUID(true);
+            chanInfo.setBufferType(BufferType.BUFFER_PER_UID);
             fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
+            ((LTTngControlService)fService).setVersion("2.0.0");
+
+        } catch (ExecutionException e) {
+            fail(e.toString());
+        }
+    }
+
+    @Test
+    public void testCreateChannelPIDBuffer() {
+        try {
+            ((LTTngControlService)fService).setVersion("2.2.0");
+            String sessionName = "mysession2";
+            List<String> list = new ArrayList<String>();
+            String USTChannel = "ustChannel";
+            list.add(USTChannel);
+            fShell.setScenario(SCEN_CHANNEL_HANDLING);
+
+
+            ChannelInfo chanInfo = new ChannelInfo("");
+            chanInfo.setOverwriteMode(true);
+            chanInfo.setSubBufferSize(-1);
+            chanInfo.setReadTimer(-1);
+            chanInfo.setSwitchTimer(-1);
+            chanInfo.setNumberOfSubBuffers(-1);
+            chanInfo.setMaxNumberTraceFiles(-1);
+            chanInfo.setMaxSizeTraceFiles(-1);
+            chanInfo.setBufferType(BufferType.BUFFER_PER_PID);
+
+            fService.enableChannels(sessionName, list, false, chanInfo, new NullProgressMonitor());
+            ((LTTngControlService)fService).setVersion("2.0.0");
 
         } catch (ExecutionException e) {
             fail(e.toString());
This page took 0.026651 seconds and 5 git commands to generate.