1 /**********************************************************************
2 * Copyright (c) 2012 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 **********************************************************************/
12 package org
.eclipse
.linuxtools
.internal
.lttng2
.stubs
.service
;
14 import org
.eclipse
.core
.commands
.ExecutionException
;
15 import org
.eclipse
.core
.runtime
.Status
;
16 import org
.eclipse
.linuxtools
.internal
.lttng2
.stubs
.shells
.LTTngToolsFileShell
;
17 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.remote
.IRemoteSystemProxy
;
18 import org
.eclipse
.linuxtools
.internal
.lttng2
.ui
.views
.control
.service
.ICommandShell
;
19 import org
.eclipse
.rse
.core
.model
.IRSECallback
;
20 import org
.eclipse
.rse
.core
.subsystems
.ICommunicationsListener
;
21 import org
.eclipse
.rse
.core
.subsystems
.ISubSystem
;
22 import org
.eclipse
.rse
.services
.shells
.IShellService
;
23 import org
.eclipse
.rse
.services
.terminals
.ITerminalService
;
24 import org
.eclipse
.rse
.subsystems
.files
.core
.servicesubsystem
.IFileServiceSubSystem
;
27 public class TestRemoteSystemProxy
implements IRemoteSystemProxy
{
29 private LTTngToolsFileShell fShell
= null;
30 private String fTestFile
= null;
31 private String fScenario
= null;
34 public IShellService
getShellService() {
39 public ITerminalService
getTerminalService() {
44 public ISubSystem
getShellServiceSubSystem() {
49 public ISubSystem
getTerminalServiceSubSystem() {
53 public IFileServiceSubSystem
getFileServiceSubSystem() {
58 public void connect(IRSECallback callback
) throws ExecutionException
{
59 // System.out.println("in done: proxy connect ");
60 if (callback
!= null) {
61 callback
.done(Status
.OK_STATUS
, null);
66 public void disconnect() throws ExecutionException
{
71 public ICommandShell
createCommandShell() throws ExecutionException
{
73 fShell
= CommandShellFactory
.getInstance().getFileShell();
74 if ((fTestFile
!= null) && (fScenario
!= null)) {
76 fShell
.loadScenarioFile(fTestFile
);
77 } catch (Exception e
) {
78 throw new ExecutionException(e
.toString());
80 fShell
.setScenario(fScenario
);
87 public void addCommunicationListener(ICommunicationsListener listener
) {
91 public void removeCommunicationListener(ICommunicationsListener listener
) {
94 public void setTestFile(String testFile
) {
98 public void setScenario(String scenario
) {
100 if (fShell
!= null) {
101 fShell
.setScenario(fScenario
);