1 /**********************************************************************
2 * Copyright (c) 2012, 2014 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
.lttng2
.control
.stubs
.service
;
15 import org
.eclipse
.core
.commands
.ExecutionException
;
16 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
17 import org
.eclipse
.remote
.core
.IRemoteConnectionChangeListener
;
18 import org
.eclipse
.remote
.core
.IRemoteFileService
;
19 import org
.eclipse
.remote
.core
.IRemoteProcessBuilder
;
20 import org
.eclipse
.tracecompass
.internal
.lttng2
.control
.stubs
.shells
.LTTngToolsFileShell
;
21 import org
.eclipse
.tracecompass
.tmf
.remote
.core
.proxy
.IRemoteSystemProxy
;
22 import org
.eclipse
.tracecompass
.tmf
.remote
.core
.shell
.ICommandShell
;
24 @SuppressWarnings("javadoc")
25 public class TestRemoteSystemProxy
implements IRemoteSystemProxy
{
27 private LTTngToolsFileShell fShell
= null;
28 private String fTestFile
= null;
29 private String fScenario
= null;
32 public IRemoteProcessBuilder
getProcessBuilder(String
... command
) {
37 public IRemoteFileService
getRemoteFileService() {
42 public void connect(IProgressMonitor monitor
) throws ExecutionException
{
46 public void disconnect() throws ExecutionException
{
51 public void dispose() {
55 public ICommandShell
createCommandShell() throws ExecutionException
{
57 fShell
= CommandShellFactory
.getInstance().getFileShell();
58 if ((fTestFile
!= null) && (fScenario
!= null)) {
60 fShell
.loadScenarioFile(fTestFile
);
61 } catch (Exception e
) {
62 throw new ExecutionException(e
.toString());
64 fShell
.setScenario(fScenario
);
71 public void addConnectionChangeListener(IRemoteConnectionChangeListener listener
) {
75 public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener
) {
78 public void setTestFile(String testFile
) {
82 public void setScenario(String scenario
) {
85 fShell
.setScenario(fScenario
);
90 public boolean isConnected() {