Commit | Line | Data |
---|---|---|
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 | 12 | package org.eclipse.linuxtools.internal.lttng2.stubs.shells; |
eb1bab5b BH |
13 | |
14 | import org.eclipse.core.commands.ExecutionException; | |
15 | import org.eclipse.core.runtime.IProgressMonitor; | |
9315aeee BH |
16 | import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.CommandResult; |
17 | import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandResult; | |
18 | import org.eclipse.linuxtools.internal.lttng2.ui.views.control.remote.ICommandShell; | |
eb1bab5b | 19 | |
cfdb727a AM |
20 | /** |
21 | * Command shell stub | |
22 | */ | |
eb1bab5b BH |
23 | public class TestCommandShell implements ICommandShell { |
24 | ||
6f4e8ec0 | 25 | /** If the shell is connected */ |
eb1bab5b | 26 | protected boolean fIsConnected = false; |
cfdb727a | 27 | |
eb1bab5b BH |
28 | @Override |
29 | public void connect() throws ExecutionException { | |
30 | fIsConnected = true; | |
31 | } | |
cfdb727a | 32 | |
eb1bab5b BH |
33 | @Override |
34 | public void disconnect() { | |
35 | fIsConnected = false; | |
36 | } | |
37 | ||
38 | @Override | |
39 | public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException { | |
40 | return executeCommand(command, monitor, true); | |
41 | } | |
42 | ||
43 | @Override | |
44 | public ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException { | |
45 | if (fIsConnected) { | |
cfdb727a | 46 | |
eb1bab5b BH |
47 | } |
48 | return new CommandResult(0, new String[0]); | |
49 | } | |
50 | } |