1 /**********************************************************************
2 * Copyright (c) 2012, 2015 Ericsson
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
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
.tmf
.remote
.core
.stubs
.shells
;
15 import org
.eclipse
.core
.commands
.ExecutionException
;
16 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
17 import org
.eclipse
.jdt
.annotation
.NonNullByDefault
;
18 import org
.eclipse
.tracecompass
.internal
.tmf
.remote
.core
.shell
.CommandInput
;
19 import org
.eclipse
.tracecompass
.internal
.tmf
.remote
.core
.shell
.CommandResult
;
20 import org
.eclipse
.tracecompass
.tmf
.remote
.core
.shell
.ICommandInput
;
21 import org
.eclipse
.tracecompass
.tmf
.remote
.core
.shell
.ICommandOutputListener
;
22 import org
.eclipse
.tracecompass
.tmf
.remote
.core
.shell
.ICommandResult
;
23 import org
.eclipse
.tracecompass
.tmf
.remote
.core
.shell
.ICommandShell
;
28 public class TestCommandShell
implements ICommandShell
{
30 /** If the shell is connected */
31 protected boolean fIsConnected
= false;
34 public void dispose() {
39 public ICommandResult
executeCommand(ICommandInput command
, IProgressMonitor monitor
) throws ExecutionException
{
40 return executeCommand(command
, monitor
, null);
44 public ICommandResult
executeCommand(ICommandInput command
, IProgressMonitor monitor
, ICommandOutputListener listener
) throws ExecutionException
{
46 return createCommandResult(0, new String
[0], new String
[0]);
48 return createCommandResult(1, new String
[0], new String
[0]);
52 public ICommandInput
createCommand() {
53 return new CommandInput();
57 * Creates a command result
60 * The result of the command
62 * The output, as an array of strings
64 * THe error output as an array of strings
65 * @return {@link ICommandResult} instance
68 protected ICommandResult
createCommandResult(int result
, String
[] output
, String
[] errorOutput
) {
69 return new CommandResult(result
, output
, errorOutput
);