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;
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";
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";
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";
+
// ------------------------------------------------------------------------
}
@Test
+ @Ignore
public void testGetSessionWithLive() {
try {
fShell.setScenario(SCEN_GET_SESSION_WITH_LIVE);
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());
}
}
- @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() {
}
@Test
+ @Ignore
public void testCreateLiveSession() throws ExecutionException {
fShell.setScenario(SCEN_CREATE_LIVE_SESSION);
}
@Test
+ @Ignore
public void testCreateLiveSessionErrors() {
try {
fShell.setScenario(SCEN_CREATE_LIVE_SESSION_ERRORS);
}
}
+ @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);