X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=org.eclipse.linuxtools.lttng.ui.tests%2Fstubs%2Forg%2Feclipse%2Flinuxtools%2Flttng%2Fstubs%2Fservice%2FTestRemoteSystemProxy.java;h=b173597f379820c1d2bfe86849f3d6d0883fd6ac;hb=d132bcc71fa0ff07cf2a3f0b6258f38abb546fb7;hp=52ab21d45b3914b0be0ed3157d9599f9d3f0adc1;hpb=f1e23c542e9b00f6dab15b7aa2960315a22d9bc4;p=deliverable%2Ftracecompass.git diff --git a/org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/lttng/stubs/service/TestRemoteSystemProxy.java b/org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/lttng/stubs/service/TestRemoteSystemProxy.java index 52ab21d45b..b173597f37 100644 --- a/org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/lttng/stubs/service/TestRemoteSystemProxy.java +++ b/org.eclipse.linuxtools.lttng.ui.tests/stubs/org/eclipse/linuxtools/lttng/stubs/service/TestRemoteSystemProxy.java @@ -1,7 +1,19 @@ +/********************************************************************** + * Copyright (c) 2012 Ericsson + * + * All rights reserved. This program and the accompanying materials are + * made available under the terms of the Eclipse Public License v1.0 which + * accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Bernd Hufmann - Initial API and implementation + **********************************************************************/ package org.eclipse.linuxtools.lttng.stubs.service; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.Status; +import org.eclipse.linuxtools.lttng.stubs.service.shells.LTTngToolsFileShell; import org.eclipse.linuxtools.lttng.ui.views.control.remote.IRemoteSystemProxy; import org.eclipse.linuxtools.lttng.ui.views.control.service.ICommandShell; import org.eclipse.rse.core.model.IRSECallback; @@ -12,6 +24,10 @@ import org.eclipse.rse.services.terminals.ITerminalService; import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem; public class TestRemoteSystemProxy implements IRemoteSystemProxy { + + private LTTngToolsFileShell fShell = null; + private String fTestFile = null; + private String fScenario = null; @Override public IShellService getShellService() { @@ -46,12 +62,23 @@ public class TestRemoteSystemProxy implements IRemoteSystemProxy { @Override public void disconnect() throws ExecutionException { + fShell = null; } @Override public ICommandShell createCommandShell() throws ExecutionException { - ICommandShell shell = CommandShellFactory.getInstance().getShellForSessionNames(); - return shell; + if (fShell == null) { + fShell = CommandShellFactory.getInstance().getFileShell(); + if ((fTestFile != null) && (fScenario != null)) { + try { + fShell.loadScenarioFile(fTestFile); + } catch (Exception e) { + throw new ExecutionException(e.toString()); + } + fShell.setScenario(fScenario); + } + } + return fShell; } @Override @@ -61,5 +88,15 @@ public class TestRemoteSystemProxy implements IRemoteSystemProxy { @Override public void removeCommunicationListener(ICommunicationsListener listener) { } - + + public void setTestFile(String testFile) { + fTestFile = testFile; + } + + public void setScenario(String scenario) { + fScenario = scenario; + if (fShell != null) { + fShell.setScenario(fScenario); + } + } }