Update project settings for CTF/LTTng/TMF
[deliverable/tracecompass.git] / org.eclipse.linuxtools.lttng2.ui.tests / stubs / org / eclipse / linuxtools / internal / lttng2 / stubs / shells / TestCommandShell.java
CommitLineData
eb1bab5b
BH
1/**********************************************************************
2 * Copyright (c) 2012 Ericsson
cfdb727a 3 *
eb1bab5b
BH
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
cfdb727a
AM
8 *
9 * Contributors:
eb1bab5b
BH
10 * Bernd Hufmann - Initial API and implementation
11 **********************************************************************/
115b4a01 12package org.eclipse.linuxtools.internal.lttng2.stubs.shells;
eb1bab5b
BH
13
14import org.eclipse.core.commands.ExecutionException;
15import org.eclipse.core.runtime.IProgressMonitor;
9315aeee
BH
16import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.CommandResult;
17import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult;
18import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandShell;
eb1bab5b 19
cfdb727a
AM
20/**
21 * Command shell stub
22 */
eb1bab5b
BH
23public class TestCommandShell implements ICommandShell {
24
25 protected boolean fIsConnected = false;
cfdb727a 26
eb1bab5b
BH
27 @Override
28 public void connect() throws ExecutionException {
29 fIsConnected = true;
30 }
cfdb727a 31
eb1bab5b
BH
32 @Override
33 public void disconnect() {
34 fIsConnected = false;
35 }
36
37 @Override
38 public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException {
39 return executeCommand(command, monitor, true);
40 }
41
42 @Override
43 public ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException {
44 if (fIsConnected) {
cfdb727a 45
eb1bab5b
BH
46 }
47 return new CommandResult(0, new String[0]);
48 }
49}
This page took 0.031147 seconds and 5 git commands to generate.