tmf: Bug 460842: Introduce tmf remote plug-ins and feature
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.ui.tests / stubs / org / eclipse / tracecompass / internal / lttng2 / control / stubs / shells / TestCommandShell.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2015 Ericsson
3 *
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
8 *
9 * Contributors:
10 * Bernd Hufmann - Initial API and implementation
11 * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
12 **********************************************************************/
13 package org.eclipse.tracecompass.internal.lttng2.control.stubs.shells;
14
15 import java.util.List;
16
17 import org.eclipse.core.commands.ExecutionException;
18 import org.eclipse.core.runtime.IProgressMonitor;
19 import org.eclipse.tracecompass.tmf.remote.core.shell.CommandResult;
20 import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandResult;
21 import org.eclipse.tracecompass.tmf.remote.core.shell.ICommandShell;
22
23 /**
24 * Command shell stub
25 */
26 public class TestCommandShell implements ICommandShell {
27
28 /** If the shell is connected */
29 protected boolean fIsConnected = false;
30
31 @Override
32 public void connect() throws ExecutionException {
33 fIsConnected = true;
34 }
35
36 @Override
37 public void disconnect() {
38 fIsConnected = false;
39 }
40
41 @Override
42 public ICommandResult executeCommand(List<String> command, IProgressMonitor monitor) throws ExecutionException {
43 if (fIsConnected) {
44 return new CommandResult(0, new String[0], new String[0]);
45 }
46 return new CommandResult(1, new String[0], new String[0]);
47 }
48 }
This page took 0.045035 seconds and 5 git commands to generate.