| 1 | /********************************************************************** |
| 2 | * Copyright (c) 2012 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 | **********************************************************************/ |
| 12 | package org.eclipse.linuxtools.internal.lttng2.stubs.shells; |
| 13 | |
| 14 | import org.eclipse.core.commands.ExecutionException; |
| 15 | import org.eclipse.core.runtime.IProgressMonitor; |
| 16 | import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.CommandResult; |
| 17 | import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandResult; |
| 18 | import org.eclipse.linuxtools.internal.lttng2.ui.views.control.service.ICommandShell; |
| 19 | |
| 20 | public class TestCommandShell implements ICommandShell { |
| 21 | |
| 22 | protected boolean fIsConnected = false; |
| 23 | |
| 24 | @Override |
| 25 | public void connect() throws ExecutionException { |
| 26 | fIsConnected = true; |
| 27 | } |
| 28 | |
| 29 | @Override |
| 30 | public void disconnect() { |
| 31 | fIsConnected = false; |
| 32 | } |
| 33 | |
| 34 | @Override |
| 35 | public ICommandResult executeCommand(String command, IProgressMonitor monitor) throws ExecutionException { |
| 36 | return executeCommand(command, monitor, true); |
| 37 | } |
| 38 | |
| 39 | @Override |
| 40 | public ICommandResult executeCommand(String command, IProgressMonitor monitor, boolean checkReturnValue) throws ExecutionException { |
| 41 | if (fIsConnected) { |
| 42 | |
| 43 | } |
| 44 | return new CommandResult(0, new String[0]); |
| 45 | } |
| 46 | } |