01b9124fc1de0112cdafb6d2c7bd4897a1a5e192
[deliverable/tracecompass.git] / org.eclipse.tracecompass.lttng2.control.ui.tests / stubs / org / eclipse / tracecompass / internal / lttng2 / control / stubs / service / TestRemoteSystemProxy.java
1 /**********************************************************************
2 * Copyright (c) 2012, 2014 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 * Markus Schorn - Bug 448058: Use org.eclipse.remote in favor of RSE
12 **********************************************************************/
13 package org.eclipse.tracecompass.internal.lttng2.control.stubs.service;
14
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.internal.lttng2.control.ui.views.remote.ICommandShell;
22 import org.eclipse.tracecompass.internal.lttng2.control.ui.views.remote.IRemoteSystemProxy;
23
24 @SuppressWarnings("javadoc")
25 public class TestRemoteSystemProxy implements IRemoteSystemProxy {
26
27 private LTTngToolsFileShell fShell = null;
28 private String fTestFile = null;
29 private String fScenario = null;
30
31 @Override
32 public IRemoteProcessBuilder getProcessBuilder(String... command) {
33 return null;
34 }
35
36 @Override
37 public IRemoteFileService getRemoteFileService() {
38 return null;
39 }
40
41 @Override
42 public void connect(IProgressMonitor monitor) throws ExecutionException {
43 }
44
45 @Override
46 public void disconnect() throws ExecutionException {
47 fShell = null;
48 }
49
50 @Override
51 public void dispose() {
52 }
53
54 @Override
55 public ICommandShell createCommandShell() throws ExecutionException {
56 if (fShell == null) {
57 fShell = CommandShellFactory.getInstance().getFileShell();
58 if ((fTestFile != null) && (fScenario != null)) {
59 try {
60 fShell.loadScenarioFile(fTestFile);
61 } catch (Exception e) {
62 throw new ExecutionException(e.toString());
63 }
64 fShell.setScenario(fScenario);
65 }
66 }
67 return fShell;
68 }
69
70 @Override
71 public void addConnectionChangeListener(IRemoteConnectionChangeListener listener) {
72 }
73
74 @Override
75 public void removeConnectionChangeListener(IRemoteConnectionChangeListener listener) {
76 }
77
78 public void setTestFile(String testFile) {
79 fTestFile = testFile;
80 }
81
82 public void setScenario(String scenario) {
83 fScenario = scenario;
84 if (fShell != null) {
85 fShell.setScenario(fScenario);
86 }
87 }
88
89 @Override
90 public boolean isConnected() {
91 return true;
92 }
93 }
This page took 0.032403 seconds and 5 git commands to generate.