Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWainer dos Santos Moschetta2015-05-21 17:32:35 -0400
committerJeff Johnston2015-06-02 12:34:44 -0400
commitc53d569b35a28027e88ff07eabbb2e79bb248a23 (patch)
treef73c011cc98729f47b408d80511c9f508991e5ac
parent61ae9452023518ba93ac987f25af17ce8116f783 (diff)
downloadorg.eclipse.linuxtools-c53d569b35a28027e88ff07eabbb2e79bb248a23.tar.gz
org.eclipse.linuxtools-c53d569b35a28027e88ff07eabbb2e79bb248a23.tar.xz
org.eclipse.linuxtools-c53d569b35a28027e88ff07eabbb2e79bb248a23.zip
Bug 467931 - adapt proxy to changes in o.e.remote and PTP
Following o.e.remote and PTP changes have broken remote proxy: - rdt and remotetools no longer supported in PTP - o.e.remote implements OSGi services now Any reference to unsupported schems will throw CoreException Added a new plug-in (org.eclipse.linuxtools.remote.proxy.tests) with tests. It is neeed to export TEST_HOST, TEST_USERNAME and TEST_PASSWORD variables to activate them, otherwise they will be skipped. Also updated PTP/remote build target to Mars milestones Change-Id: Iab26eda77dee809bd4122f9001184c5fe4d4dd81 Signed-off-by: Wainer dos Santos Moschetta <wainersm@linux.vnet.ibm.com> Reviewed-on: https://git.eclipse.org/r/49227 Tested-by: Hudson CI Reviewed-by: Jeff Johnston <jjohnstn@redhat.com> Tested-by: Jeff Johnston <jjohnstn@redhat.com>
-rw-r--r--oprofile/org.eclipse.linuxtools.oprofile.remote.launch/plugin.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/META-INF/MANIFEST.MF6
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/plugin.xml4
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/Activator.java13
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/RDTResourceSelectorProxy.java38
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java8
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.tests/META-INF/MANIFEST.MF11
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.tests/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/profiling/tests/AbstractRemoteTest.java334
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF5
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/plugin.xml12
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml2
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/Activator.java14
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java16
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java11
-rw-r--r--profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java27
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/.classpath7
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/.project28
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/META-INF/MANIFEST.MF21
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/about.html28
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/build.properties6
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.cproject105
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.gitignore1
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.project26
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/main.c11
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.cproject105
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.gitignore1
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.project26
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/main.c7
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/AbstractProxyTest.java92
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/CommandLauncherProxyTest.java145
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/FileProxyTest.java128
-rw-r--r--profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/RemoteProxyManagerTest.java164
-rw-r--r--releng/org.eclipse.linuxtools.target/linuxtools-e4.5.target15
36 files changed, 1149 insertions, 281 deletions
diff --git a/oprofile/org.eclipse.linuxtools.oprofile.remote.launch/plugin.xml b/oprofile/org.eclipse.linuxtools.oprofile.remote.launch/plugin.xml
index 2466474493..eb7b2f7e99 100644
--- a/oprofile/org.eclipse.linuxtools.oprofile.remote.launch/plugin.xml
+++ b/oprofile/org.eclipse.linuxtools.oprofile.remote.launch/plugin.xml
@@ -36,7 +36,7 @@
point="org.eclipse.linuxtools.oprofile.core.OpcontrolProvider">
<opcontrolProvider
class="org.eclipse.linuxtools.internal.oprofile.remote.core.linux.RemoteLinuxOpcontrolProvider"
- scheme="remotetools">
+ scheme="ssh">
</opcontrolProvider>
</extension>
<extension
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/META-INF/MANIFEST.MF
index 6a4d844111..0f9ce82174 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/META-INF/MANIFEST.MF
@@ -3,13 +3,13 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Vendor: %bundleVendor
Bundle-SymbolicName: org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy;singleton:=true
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.internal.profiling.launch.ui.rdt.proxy.Activator
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.remote.core,
- org.eclipse.remote.ui,
+ org.eclipse.remote.core;bundle-version="2.0.0",
+ org.eclipse.remote.ui;bundle-version="2.0.0",
org.eclipse.linuxtools.profiling.launch;bundle-version="1.2.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/plugin.xml b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/plugin.xml
index 53d6ec9268..c6f7f889e2 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/plugin.xml
+++ b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/plugin.xml
@@ -13,8 +13,8 @@
point="org.eclipse.linuxtools.profiling.launch.RemoteResourceSelectorProxy">
<resourceSelectorProxy
class="org.eclipse.linuxtools.internal.profiling.launch.ui.rdt.proxy.RDTResourceSelectorProxy"
- scheme="remotetools"
- schemeLabel="Remote Tools">
+ scheme="ssh"
+ schemeLabel="SSH">
</resourceSelectorProxy>
</extension>
<extension
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/pom.xml b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/pom.xml
index 6fefc567d0..716e1c5dcf 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/pom.xml
+++ b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/pom.xml
@@ -19,7 +19,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools Resource Selector Proxy for RDT</name>
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/Activator.java b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/Activator.java
index 3c4bb82a75..dc91295744 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/Activator.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/Activator.java
@@ -13,6 +13,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
/**
* The activator class controls the plug-in life cycle
@@ -53,5 +54,17 @@ public class Activator extends AbstractUIPlugin {
log(status, msg, null);
}
+ /**
+ * Get an OSGi service
+ *
+ * @param <T>
+ * @param service
+ * @return the service implementation
+ */
+ public static <T> T getService(Class<T> service) {
+ BundleContext context = plugin.getBundle().getBundleContext();
+ ServiceReference<T> ref = context.getServiceReference(service);
+ return ref != null ? context.getService(ref) : null;
+ }
}
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/RDTResourceSelectorProxy.java b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/RDTResourceSelectorProxy.java
index e1d601a152..dfa49cba38 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/RDTResourceSelectorProxy.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy/src/org/eclipse/linuxtools/internal/profiling/launch/ui/rdt/proxy/RDTResourceSelectorProxy.java
@@ -17,13 +17,11 @@ import java.net.URISyntaxException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.linuxtools.profiling.launch.ui.IRemoteResourceSelectorProxy;
import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.remote.core.IRemoteFileManager;
-import org.eclipse.remote.core.IRemoteServices;
-import org.eclipse.remote.core.RemoteServices;
+import org.eclipse.remote.core.IRemoteConnectionType;
+import org.eclipse.remote.core.IRemoteFileService;
+import org.eclipse.remote.core.IRemoteServicesManager;
import org.eclipse.remote.ui.IRemoteUIConstants;
-import org.eclipse.remote.ui.IRemoteUIFileManager;
-import org.eclipse.remote.ui.IRemoteUIServices;
-import org.eclipse.remote.ui.RemoteUIServices;
+import org.eclipse.remote.ui.IRemoteUIFileService;
import org.eclipse.swt.widgets.Shell;
public class RDTResourceSelectorProxy implements IRemoteResourceSelectorProxy {
@@ -40,7 +38,7 @@ public class RDTResourceSelectorProxy implements IRemoteResourceSelectorProxy {
}
private URI selectResource(String scheme, String initialPath, String prompt, Shell shell, ResourceType resourceType) {
- IRemoteUIFileManager uiFileManager;
+ IRemoteUIFileService uiFileService;
boolean schemeSwitch = false;
URI uri;
try {
@@ -53,25 +51,25 @@ public class RDTResourceSelectorProxy implements IRemoteResourceSelectorProxy {
uri = getEmptyPathURI(scheme);
schemeSwitch = true;
}
- // If the user is switching schemes, start with an empty host and path
- IRemoteServices services = RemoteServices.getRemoteServices(uri);
- IRemoteUIServices uiServices = RemoteUIServices.getRemoteUIServices(services);
+ IRemoteServicesManager sm = Activator.getService(IRemoteServicesManager.class);
+ IRemoteConnectionType ct = sm.getConnectionType(uri);
+ IRemoteConnection connection = ct.getConnection(uri);
+ IRemoteFileService fileService = connection.getService(IRemoteFileService.class);
- uiFileManager = uiServices.getUIFileManager();
- uiFileManager.showConnections(true);
- IRemoteConnection connection = null;
+ // If the user is switching schemes, start with an empty host and path
+ uiFileService = ct.getService(IRemoteUIFileService.class);
+ uiFileService.showConnections(true);
if (!schemeSwitch) {
- connection = services.getConnectionManager().getConnection(uri);
- uiFileManager.setConnection(connection);
+ uiFileService.setConnection(connection);
}
String selectedPath = null;
switch (resourceType) {
case FILE:
- selectedPath = uiFileManager.browseFile(shell, prompt, uri.getPath(), IRemoteUIConstants.NONE);
+ selectedPath = uiFileService.browseFile(shell, prompt, uri.getPath(), IRemoteUIConstants.NONE);
break;
case DIRECTORY:
- selectedPath = uiFileManager.browseDirectory(shell, prompt, uri.getPath(), IRemoteUIConstants.NONE);
+ selectedPath = uiFileService.browseDirectory(shell, prompt, uri.getPath(), IRemoteUIConstants.NONE);
break;
default:
Activator.log(IStatus.ERROR, Messages.RDTResourceSelectorProxy_unsupported_resourceType + resourceType);
@@ -79,9 +77,9 @@ public class RDTResourceSelectorProxy implements IRemoteResourceSelectorProxy {
}
URI selectedURI = null;
if (selectedPath != null) {
- connection = uiFileManager.getConnection();
- IRemoteFileManager remoteFileManager = connection.getFileManager();
- selectedURI = remoteFileManager.toURI(selectedPath);
+ connection = uiFileService.getConnection();
+ fileService = connection.getService(IRemoteFileService.class);
+ selectedURI = fileService.toURI(selectedPath);
}
return selectedURI;
}
diff --git a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
index eacf8ab259..5ba2f53387 100644
--- a/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
+++ b/profiling/org.eclipse.linuxtools.profiling.launch/src/org/eclipse/linuxtools/profiling/launch/RemoteProxyManager.java
@@ -124,6 +124,9 @@ public class RemoteProxyManager implements IRemoteProxyManager {
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
return manager.getLauncher(uri);
+ else
+ throw new CoreException(new Status(IStatus.ERROR, ProfileLaunchPlugin.PLUGIN_ID,
+ IStatus.OK, Messages.RemoteProxyManager_unrecognized_scheme + scheme, null));
}
return new LocalLauncher();
}
@@ -149,6 +152,9 @@ public class RemoteProxyManager implements IRemoteProxyManager {
IRemoteProxyManager manager = getRemoteManager(scheme);
if (manager != null)
return manager.getOS(uri);
+ else
+ throw new CoreException(new Status(IStatus.ERROR, ProfileLaunchPlugin.PLUGIN_ID,
+ IStatus.OK, Messages.RemoteProxyManager_unrecognized_scheme + scheme, null));
}
return Platform.getOS();
}
@@ -170,7 +176,7 @@ public class RemoteProxyManager implements IRemoteProxyManager {
* have a cached path and a remote one, and this method
* returns the remote one.
* @param project The project which location is needed.
- * @return The project location.
+ * @return The URI to the project location.
* @throws CoreException If problem retrieving remote proxy occured.
* @since 2.2
*/
diff --git a/profiling/org.eclipse.linuxtools.profiling.tests/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.profiling.tests/META-INF/MANIFEST.MF
index a7a952ad74..bad2330fff 100644
--- a/profiling/org.eclipse.linuxtools.profiling.tests/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.profiling.tests/META-INF/MANIFEST.MF
@@ -2,15 +2,16 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %Bundle-Name.0
Bundle-SymbolicName: org.eclipse.linuxtools.profiling.tests
-Bundle-Version: 1.0.0.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Vendor: %Bundle-Vendor.0
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.junit;bundle-version="4.10.0",
org.eclipse.cdt.core,
org.eclipse.ui.ide,
- org.eclipse.remote.core,
- org.eclipse.ptp.rdt.managedbuilder.gnu.ui;bundle-version="3.0.0"
+ org.eclipse.remote.core;bundle-version="2.0.0",
+ org.eclipse.ptp.rdt.sync.core,
+ org.eclipse.remote.jsch.core
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
@@ -26,8 +27,4 @@ Import-Package: org.eclipse.cdt.build.core.scannerconfig,
org.eclipse.core.resources,
org.eclipse.debug.core,
org.eclipse.debug.ui,
- org.eclipse.ptp.rdt.core.remotemake,
- org.eclipse.ptp.rdt.core.resources,
- org.eclipse.ptp.rdt.ui.serviceproviders,
- org.eclipse.ptp.services.core,
org.eclipse.ui.wizards.datatransfer
diff --git a/profiling/org.eclipse.linuxtools.profiling.tests/pom.xml b/profiling/org.eclipse.linuxtools.profiling.tests/pom.xml
index 875d2e9312..c6f86b3a41 100644
--- a/profiling/org.eclipse.linuxtools.profiling.tests/pom.xml
+++ b/profiling/org.eclipse.linuxtools.profiling.tests/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.profiling.tests</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools Profiling Tests Plug-in</name>
diff --git a/profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/profiling/tests/AbstractRemoteTest.java b/profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/profiling/tests/AbstractRemoteTest.java
index 3ad6dd4520..68a247f8c6 100644
--- a/profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/profiling/tests/AbstractRemoteTest.java
+++ b/profiling/org.eclipse.linuxtools.profiling.tests/src/org/eclipse/linuxtools/profiling/tests/AbstractRemoteTest.java
@@ -12,69 +12,36 @@ package org.eclipse.linuxtools.profiling.tests;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeTrue;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
-import java.net.URI;
import java.net.URISyntaxException;
-import org.eclipse.cdt.build.core.scannerconfig.ScannerConfigNature;
-import org.eclipse.cdt.core.CCorePlugin;
-import org.eclipse.cdt.core.index.IIndexManager;
-import org.eclipse.cdt.core.model.CoreModel;
-import org.eclipse.cdt.managedbuilder.core.IBuilder;
-import org.eclipse.cdt.managedbuilder.core.IConfiguration;
-import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
-import org.eclipse.cdt.managedbuilder.core.IProjectType;
-import org.eclipse.cdt.managedbuilder.core.IToolChain;
-import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
-import org.eclipse.cdt.managedbuilder.core.ManagedCProjectNature;
-import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
-import org.eclipse.cdt.managedbuilder.internal.core.ManagedBuildInfo;
-import org.eclipse.cdt.managedbuilder.internal.core.ManagedProject;
-import org.eclipse.cdt.managedbuilder.internal.core.ToolChain;
-import org.eclipse.cdt.utils.EFSExtensionManager;
-import org.eclipse.cdt.core.settings.model.ICProjectDescription;
-import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
-import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
-import org.eclipse.cdt.core.CProjectNature;
-import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.core.filesystem.EFS;
-import org.eclipse.core.filesystem.IFileInfo;
import org.eclipse.core.filesystem.IFileStore;
-import org.eclipse.core.filesystem.IFileSystem;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.ptp.rdt.core.remotemake.RemoteMakeBuilder;
-import org.eclipse.ptp.rdt.core.resources.RemoteMakeNature;
-import org.eclipse.ptp.rdt.ui.serviceproviders.IRemoteToolsIndexServiceProvider;
-import org.eclipse.ptp.rdt.ui.serviceproviders.RemoteBuildServiceProvider;
-import org.eclipse.remote.core.IRemoteConnectionWorkingCopy;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.ptp.rdt.sync.core.SyncConfig;
+import org.eclipse.ptp.rdt.sync.core.SyncConfigManager;
+import org.eclipse.ptp.rdt.sync.core.SyncFlag;
+import org.eclipse.ptp.rdt.sync.core.SyncManager;
import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.remote.core.IRemoteConnectionManager;
-import org.eclipse.remote.core.IRemoteFileManager;
-import org.eclipse.remote.core.IRemoteServices;
-import org.eclipse.remote.core.RemoteServices;
+import org.eclipse.remote.core.IRemoteConnectionType;
+import org.eclipse.remote.core.IRemoteConnectionWorkingCopy;
+import org.eclipse.remote.core.IRemoteFileService;
+import org.eclipse.remote.core.IRemoteServicesManager;
import org.eclipse.remote.core.exception.RemoteConnectionException;
-import org.eclipse.ptp.services.core.IService;
-import org.eclipse.ptp.services.core.IServiceConfiguration;
-import org.eclipse.ptp.services.core.IServiceProviderDescriptor;
-import org.eclipse.ptp.services.core.ServiceModelManager;
+import org.eclipse.remote.internal.jsch.core.JSchConnection;
import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
@SuppressWarnings("restriction")
public abstract class AbstractRemoteTest extends AbstractTest {
+ private static final String PLUGIN_ID="org.eclipse.linuxtools.profiling.tests";
public static final String REMOTE_NATURE_ID = "org.eclipse.ptp.rdt.core.remoteNature"; //$NON-NLS-1$
public static final String REMOTE_SERVICES = "org.eclipse.ptp.remote.RemoteTools"; //$NON-NLS-1$
public static final String REMOTE_MAKE_NATURE = "org.eclipse.ptp.rdt.core.remoteMakeNature"; //$NON-NLS-1$
@@ -85,17 +52,44 @@ public abstract class AbstractRemoteTest extends AbstractTest {
public static final String TOOLCHAIN_ID = "org.eclipse.ptp.rdt.managedbuild.toolchain.gnu.base"; //$NON-NLS-1$
public static final String PTP_EXE = "org.eclipse.ptp.rdt.managedbuild.target.gnu.exe"; //$NON-NLS-1$
public static final String DEBUG = "Debug"; //$NON-NLS-1$
- public static final String USERNAME = ""; //$NON-NLS-1$
- private static final String PASSWORD = ""; //$NON-NLS-1$
+ public static String USERNAME = ""; //$NON-NLS-1$
+ private static String PASSWORD = ""; //$NON-NLS-1$
+ public static final String CONNECTION_TYPE_JSCH = "org.eclipse.remote.JSch";
+ public static final String SYNC_SERVICE_GIT = "org.eclipse.ptp.rdt.sync.git.core.synchronizeService";
+
// Sets localhost as default connection if no remote host is given
- private static String HOST = "localhost"; //$NON-NLS-1$
+ private static String HOST = ""; //$NON-NLS-1$
public static String CONNECTION_NAME = "localhost"; //$NON-NLS-1$
public static final String RESOURCES_DIR = "resources/"; //$NON-NLS-1$
- private IRemoteServices fRemoteServices;
private IRemoteConnectionWorkingCopy fRemoteConnection;
+
+ // Skip tests if there is not suitable connection details
+ public static void checkConnectionInfo() {
+ String host = System.getenv("TEST_HOST");
+ if (host != null) {
+ HOST = host;
+ }
+ assumeTrue("Skip remote tests due lack of host information", !HOST.isEmpty());
+
+ String username = System.getenv("TEST_USERNAME");
+ if (username != null) {
+ USERNAME = username;
+ }
+ assumeTrue("Skip remote tests due lack of an username for connection", !USERNAME.isEmpty());
+
+ String password = System.getenv("TEST_PASSWORD");
+ if (password != null) {
+ PASSWORD = password;
+ }
+ assumeTrue("Skip remote tests due lack of an password for connection", !PASSWORD.isEmpty());
+ }
+
/**
+ * @deprecated As of 1.1, this should not be used because PTP no more provides
+ * rdt managed projects.
+ *
* Create a CDT project outside the default workspace.
*
* @param bundle The plug-in bundle.
@@ -109,155 +103,16 @@ public abstract class AbstractRemoteTest extends AbstractTest {
* @throws InvocationTargetException
* @throws InterruptedException
*/
- protected IProject createRemoteExternalProject(Bundle bundle,
+ @Deprecated protected IProject createRemoteExternalProject(Bundle bundle,
final String projname, final String absProjectPath,
final String sourceFile) throws CoreException, URISyntaxException, IOException {
-
- IProject externalProject;
- // Turn off auto-building
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- IWorkspaceDescription wspDesc = workspace.getDescription();
- wspDesc.setAutoBuilding(false);
- workspace.setDescription(wspDesc);
-
- // Create external project
- IWorkspaceRoot root = workspace.getRoot();
- externalProject = root.getProject(projname);
- IProjectDescription description = workspace.newProjectDescription(projname);
-
- // Get services responsible for handling the remote connection
- fRemoteServices = RemoteServices.getRemoteServices(REMOTE_SERVICES);
- assertNotNull(fRemoteServices);
-
- // Create connection manager
- IRemoteConnectionManager connMgr = fRemoteServices.getConnectionManager();
- assertNotNull(connMgr);
-
- try {
- // Creates a localhost connection or a remote one if one is
- // specified by createRemoteExternalProjectAndBuild
- fRemoteConnection = connMgr.newConnection(CONNECTION_NAME);
- } catch (RemoteConnectionException e) {
- fail(e.getLocalizedMessage());
- }
- assertNotNull(fRemoteConnection);
- // Sets the connection arguments
- fRemoteConnection.setAddress(HOST);
- fRemoteConnection.setUsername(USERNAME);
- fRemoteConnection.setPassword(PASSWORD);
-
- try {
- fRemoteConnection.open(new NullProgressMonitor());
- } catch (RemoteConnectionException e) {
- fail(e.getLocalizedMessage());
- }
- assertTrue(fRemoteConnection.isOpen());
-
- // Sets the location of the remote project
- // RDT format is as follows: remotetools://connectionName/directory
- URI fileProjectURL = new URI(absProjectPath);
- description.setLocationURI(fileProjectURL);
- // Creates CDT project
- externalProject = CCorePlugin.getDefault().createCDTProject(
- description, externalProject, new NullProgressMonitor());
- String pathString = EFSExtensionManager.getDefault().getPathFromURI(externalProject.getLocationURI());
- IPath buildPath = Path.fromPortableString(pathString);
- assertNotNull(externalProject);
- assertTrue(externalProject.isOpen());
-
- // Add the necessary natures to the remote project
- CProjectNature.addCNature(externalProject, new NullProgressMonitor());
- CCProjectNature.addCCNature(externalProject, new NullProgressMonitor());
- CProjectNature.addNature(externalProject, AbstractRemoteTest.REMOTE_NATURE_ID, new NullProgressMonitor());
- ManagedCProjectNature.addManagedNature(externalProject, null);
- ScannerConfigNature.addScannerConfigNature(externalProject);
- // Since it is a remote makefile project, add the make nature
- CProjectNature.addNature(externalProject, REMOTE_MAKE_NATURE, new NullProgressMonitor());
- // Creates a service model required by RDT projects
- ServiceModelManager.getInstance().addConfiguration(externalProject, ServiceModelManager.getInstance().newServiceConfiguration(externalProject.getName()));
- ServiceModelManager smm = ServiceModelManager.getInstance();
- // Creates a Service Configuration for this CDT project
- // RDT needs it in order to build the project later
- IServiceConfiguration config = ServiceModelManager.getInstance().newServiceConfiguration(externalProject.getName());
- IService buildService = smm.getService(BUILD_SERVICE);
- IServiceProviderDescriptor descriptor = buildService.getProviderDescriptor(RemoteBuildServiceProvider.ID);
- RemoteBuildServiceProvider rbsp = (RemoteBuildServiceProvider) smm.getServiceProvider(descriptor);
- if (rbsp != null) {
- rbsp.setRemoteToolsConnection(fRemoteConnection);
- config.setServiceProvider(buildService, rbsp);
- }
- IService indexingService = smm.getService(CINDEX_SERVICE);
- descriptor = indexingService.getProviderDescriptor(RDT_CINDEX_SERVICE);
- IRemoteToolsIndexServiceProvider provider = (IRemoteToolsIndexServiceProvider) smm
- .getServiceProvider(descriptor);
- if (provider != null) {
- provider.setConnection(fRemoteConnection);
- config.setServiceProvider(indexingService, provider);
- }
- // Adds the service configuration with the properties defined to the CDT project
- smm.addConfiguration(externalProject, config);
- smm.setActiveConfiguration(externalProject, config);
- smm.saveModelConfiguration();
-
- // Adds a description and a configuration the the CDT project
- ICProjectDescriptionManager mngr =
- CoreModel.getDefault().getProjectDescriptionManager();
- ICProjectDescription des = mngr.createProjectDescription(externalProject, false);
- ManagedBuildInfo info = ManagedBuildManager.createBuildInfo(externalProject);
- IProjectType type = ManagedBuildManager.getProjectType(PTP_EXE);
- IToolChain tc = ManagedBuildManager.getExtensionToolChain(TOOLCHAIN_ID); // or get toolChain from UI
- ManagedProject mProj = new ManagedProject(des);
- info.setManagedProject(mProj);
- IConfiguration cfgs[] = type.getConfigurations();
- assertNotNull(cfgs);
- assertTrue(cfgs.length>0);
-
- for (IConfiguration configuration : cfgs) {
- String id = ManagedBuildManager.calculateChildId(configuration.getToolChain().getId(), null);
- Configuration cfg = new Configuration(mProj, (ToolChain) tc, id, DEBUG);
- IBuilder bld = cfg.getEditableBuilder();
- bld = cfg.getEditableBuilder();
- bld.setBuildPath(pathString);
- CConfigurationData configurationData = cfg.getConfigurationData();
- assertNotNull(configurationData);
- des.createConfiguration(ManagedBuildManager.CFG_DATA_PROVIDER_ID, configurationData);
- }
- mngr.setProjectDescription(externalProject, des);
-
- // The source file in the plug-in test package is copied to the specified directory
- final IRemoteFileManager fileManager = fRemoteConnection.getFileManager();
- final IFileStore dstFileStore = fileManager.getResource(pathString);
- IFileSystem fileSystem = EFS.getLocalFileSystem();
- IFileStore srcFileStore = fileSystem.getStore(URI.create(RESOURCES_DIR + projname));
- srcFileStore.copy(dstFileStore, EFS.OVERWRITE , null);
- externalProject.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- IFileInfo dstInfo = dstFileStore.fetchInfo();
- assertTrue(dstInfo.exists());
-
-
- RemoteMakeNature.updateProjectDescription(externalProject, RemoteMakeBuilder.REMOTE_MAKE_BUILDER_ID, new NullProgressMonitor());
-
- IManagedBuildInfo mbsInfo = ManagedBuildManager.getBuildInfo(externalProject);
- mbsInfo.getDefaultConfiguration().getBuildData().setBuilderCWD(buildPath);
- mbsInfo.setDirty(true);
- ManagedBuildManager.saveBuildInfo(externalProject, true);
-
- try {
- // CDT opens the Project with BACKGROUND_REFRESH enabled which causes the
- // refresh manager to refresh the project 200ms later. This Job interferes
- // with the resource change handler firing see: bug 271264
- Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_REFRESH, null);
- } catch (Exception e) {
- // Ignore
- }
- assertTrue(externalProject.isOpen());
-
- // Index the project
- IIndexManager indexMgr = CCorePlugin.getIndexManager();
- indexMgr.joinIndexer(IIndexManager.FOREVER, new NullProgressMonitor());
- return externalProject;
+ return null;
}
- protected IProject createRemoteExternalProjectAndBuild(Bundle bundle,
+ /**
+ * @deprecated As of 1.1, this should not be used because PTP no more provides
+ * rdt managed projects.
+ */
+ @Deprecated protected IProject createRemoteExternalProjectAndBuild(Bundle bundle,
String projname, String absProjectPath, String sourceFile, String host,
String connectionName) throws CoreException, URISyntaxException, IOException {
HOST = host;
@@ -267,7 +122,11 @@ public abstract class AbstractRemoteTest extends AbstractTest {
return proj;
}
- protected IProject createRemoteExternalProjectAndBuild(Bundle bundle,
+ /**
+ * @deprecated As of 1.1, this should not be used because PTP no more provides
+ * rdt managed projects.
+ */
+ @Deprecated protected IProject createRemoteExternalProjectAndBuild(Bundle bundle,
String projname, String absProjectPath, String sourceFile) throws CoreException, URISyntaxException, IOException {
IProject proj = createRemoteExternalProject(bundle, projname, absProjectPath, sourceFile);
buildProject(proj);
@@ -275,21 +134,82 @@ public abstract class AbstractRemoteTest extends AbstractTest {
}
protected void deleteResource (String directory) {
- IRemoteServices fRemoteServices;
- IRemoteConnection fRemoteConnection;
- fRemoteServices = RemoteServices.getRemoteServices(REMOTE_SERVICES);
- assertNotNull(fRemoteServices);
-
- IRemoteConnectionManager connMgr = fRemoteServices.getConnectionManager();
- assertNotNull(connMgr);
- fRemoteConnection = connMgr.getConnection(CONNECTION_NAME);
- final IRemoteFileManager fileManager = fRemoteConnection.getFileManager();
+ IRemoteServicesManager sm = getServicesManager();
+ IRemoteConnection conn = sm.getConnectionType("ssh").getConnection(CONNECTION_NAME);
+ assertNotNull(conn);
+ IRemoteFileService fileManager = conn.getService(IRemoteFileService.class);
+ assertNotNull(fileManager);
final IFileStore dstFileStore = fileManager.getResource(directory);
try {
dstFileStore.delete(EFS.NONE, null);
} catch (CoreException e) {
}
}
+ /**
+ * Create a new connection. Save the connection working copy before return.
+ *
+ * @param connName Connection Name
+ * @param connTypeId The connection type identifier
+ * @return The created remote connection
+ * @throws RemoteConnectionException
+ */
+ protected static IRemoteConnection createJSchConnection(String connName, String connTypeId) throws RemoteConnectionException {
+ checkConnectionInfo();
+ IRemoteServicesManager manager = getServicesManager();
+ IRemoteConnectionType ct = manager.getConnectionType(connTypeId);
+ assertNotNull(ct);
+ IRemoteConnectionWorkingCopy wc = ct.newConnection(connName);
+ wc.setAttribute(JSchConnection.ADDRESS_ATTR, HOST);
+ wc.setAttribute(JSchConnection.USERNAME_ATTR, USERNAME);
+ wc.setSecureAttribute(JSchConnection.PASSWORD_ATTR, PASSWORD);
+ IRemoteConnection conn = wc.save();
+ assertNotNull(conn);
+ conn.open(new NullProgressMonitor());
+ assertTrue(conn.isOpen());
+ return conn;
+ }
+
+ /**
+ * Delete connection
+ *
+ * @param conn The connection
+ * @throws RemoteConnectionException
+ */
+ protected static void deleteConnection(IRemoteConnection conn) throws RemoteConnectionException {
+ IRemoteConnectionType ct = conn.getConnectionType();
+ ct.removeConnection(conn);
+ }
+ /**
+ * Prepare a sync project from an already available local project
+ *
+ * @param project any local project
+ * @param conn remote connection
+ * @param location sync'ed folder path in remote machine
+ * @throws CoreException
+ */
+ protected static void convertToSyncProject(IProject project, IRemoteConnection conn, String location) throws CoreException {
+ // Convert to sync project without file filters
+ SyncManager.makeSyncProject(project, conn.getName() + "_sync", SYNC_SERVICE_GIT, conn, location, null);
+ // Synchronize project from local to remote
+ SyncManager.sync(null, project, SyncFlag.LR_ONLY, null);
+ }
+
+ /**
+ * Get the *active* synchronize configuration associated with the project
+ *
+ * @param project A sync project
+ * @return the active synchronize configuration
+ */
+ protected static SyncConfig getSyncConfig(IProject project) {
+ return SyncConfigManager.getActive(project);
+ }
+
+ private static IRemoteServicesManager getServicesManager() {
+ BundleContext context = Platform.getBundle(PLUGIN_ID).getBundleContext();
+ ServiceReference<IRemoteServicesManager> ref = context.getServiceReference(IRemoteServicesManager.class);
+ assertNotNull(ref);
+ return context.getService(ref);
+ }
}
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF
index 564bcb867d..6dbd4ae9fc 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/META-INF/MANIFEST.MF
@@ -2,12 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-SymbolicName: org.eclipse.linuxtools.rdt.proxy;singleton:=true
-Bundle-Version: 1.1.0.qualifier
+Bundle-Version: 1.2.0.qualifier
Bundle-Activator: org.eclipse.linuxtools.internal.rdt.proxy.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
- org.eclipse.ptp.rdt.core;bundle-version="3.1.0",
- org.eclipse.remote.core,
+ org.eclipse.remote.core;bundle-version="2.0.0",
org.eclipse.linuxtools.profiling.launch;bundle-version="0.8.0",
org.eclipse.core.resources;bundle-version="3.7.100",
org.eclipse.core.filesystem;bundle-version="1.3.100"
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/plugin.xml b/profiling/org.eclipse.linuxtools.rdt.proxy/plugin.xml
index 04ce94c2e8..4472f56074 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/plugin.xml
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/plugin.xml
@@ -12,22 +12,14 @@
point="org.eclipse.linuxtools.profiling.launch.RemoteProxyManager">
<manager
class="org.eclipse.linuxtools.internal.rdt.proxy.RDTProxyManager"
- scheme="remotetools">
+ scheme="ssh">
</manager>
</extension>
<extension
point="org.eclipse.linuxtools.profiling.launch.RemoteProxyNatureMapping">
<mapping
nature="org.eclipse.ptp.rdt.sync.core.remoteSyncNature"
- schema="remotetools">
+ schema="ssh">
</mapping>
</extension>
- <extension
- point="org.eclipse.linuxtools.profiling.launch.RemoteProxyNatureMapping">
- <mapping
- nature="org.eclipse.ptp.rdt.core.remoteNature"
- schema="remotetools">
- </mapping>
- </extension>
-
</plugin>
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml b/profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml
index 211a254cbe..57db94e823 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/pom.xml
@@ -18,7 +18,7 @@
</parent>
<artifactId>org.eclipse.linuxtools.rdt.proxy</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>Linux Tools RDT Proxy Plug-in</name>
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/Activator.java b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/Activator.java
index 366486d5b6..fe07fe66a8 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/Activator.java
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/Activator.java
@@ -17,6 +17,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
/**
* The activator class controls the plug-in life cycle
@@ -87,4 +88,17 @@ public class Activator extends AbstractUIPlugin {
public static void log(int severity, String msg, Exception e) {
getDefault().getLog().log(new Status(severity, PLUGIN_ID, IStatus.OK, msg, e));
}
+
+ /**
+ * Get an OSGi service
+ *
+ * @param service the service class
+ * @return the Service implementation
+ */
+ public static <T> T getService(Class<T> service) {
+ BundleContext context = plugin.getBundle().getBundleContext();
+ ServiceReference<T> ref = context.getServiceReference(service);
+ return ref != null ? context.getService(ref) : null;
+ }
+
}
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java
index 4fa6fd228a..4eba33290c 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTCommandLauncher.java
@@ -25,13 +25,12 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher;
import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.remote.core.IRemoteFileManager;
+import org.eclipse.remote.core.IRemoteFileService;
import org.eclipse.remote.core.IRemoteProcess;
import org.eclipse.remote.core.IRemoteProcessBuilder;
+import org.eclipse.remote.core.IRemoteProcessService;
import org.eclipse.remote.core.IRemoteResource;
-import org.eclipse.remote.core.IRemoteServices;
import org.eclipse.remote.core.RemoteProcessAdapter;
-import org.eclipse.remote.core.RemoteServices;
/**
* @noextend This class is not intended to be subclassed by clients.
@@ -120,13 +119,14 @@ public class RDTCommandLauncher implements IRemoteCommandLauncher {
// add platform specific arguments (shell invocation)
fCommandArgs = constructCommandArray(commandPath.toOSString(), args);
fShowCommand = true;
- IRemoteServices services = RemoteServices.getRemoteServices(uri);
- IRemoteConnection connection = services.getConnectionManager().getConnection(uri);
- IRemoteFileManager fm = connection.getFileManager();
- IRemoteProcessBuilder builder = connection.getProcessBuilder(Arrays.asList(fCommandArgs));
+ IRemoteConnection connection = RDTProxyManager.getConnection(uri);
+ IRemoteProcessService ps = connection.getService(IRemoteProcessService.class);
+ IRemoteProcessBuilder builder = ps.getProcessBuilder(Arrays.asList(fCommandArgs));
- if (changeToDirectory != null)
+ if (changeToDirectory != null) {
+ IRemoteFileService fm = connection.getService(IRemoteFileService.class);
builder.directory(fm.getResource(changeToDirectory.toString()));
+ }
Map<String,String> envMap = builder.environment();
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java
index 134cf00b0a..c26042261b 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTFileProxy.java
@@ -23,22 +23,19 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.linuxtools.profiling.launch.IRemoteFileProxy;
import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.remote.core.IRemoteFileManager;
+import org.eclipse.remote.core.IRemoteFileService;
import org.eclipse.remote.core.IRemoteResource;
-import org.eclipse.remote.core.IRemoteServices;
-import org.eclipse.remote.core.RemoteServices;
public class RDTFileProxy implements IRemoteFileProxy {
private IProject project;
- private IRemoteFileManager manager;
+ private IRemoteFileService manager;
private IRemoteResource remoteRes;
private void initialize(URI uri) throws CoreException {
- IRemoteServices services = RemoteServices.getRemoteServices(uri);
- IRemoteConnection connection = services.getConnectionManager().getConnection(uri);
+ IRemoteConnection connection = RDTProxyManager.getConnection(uri);
if (connection != null) {
- manager = connection.getFileManager();
+ manager = connection.getService(IRemoteFileService.class);
} else {
throw new CoreException(new Status(IStatus.ERROR, Activator.PLUGIN_ID,
Activator.getResourceString("Connection.error"))); //$NON-NLS-1$
diff --git a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java
index 2aef64c2f0..d5e6e13c46 100644
--- a/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java
+++ b/profiling/org.eclipse.linuxtools.rdt.proxy/src/org/eclipse/linuxtools/internal/rdt/proxy/RDTProxyManager.java
@@ -25,8 +25,9 @@ import org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher;
import org.eclipse.linuxtools.profiling.launch.IRemoteEnvProxyManager;
import org.eclipse.linuxtools.profiling.launch.IRemoteFileProxy;
import org.eclipse.remote.core.IRemoteConnection;
-import org.eclipse.remote.core.IRemoteServices;
-import org.eclipse.remote.core.RemoteServices;
+import org.eclipse.remote.core.IRemoteConnectionType;
+import org.eclipse.remote.core.IRemoteProcessService;
+import org.eclipse.remote.core.IRemoteServicesManager;
import org.eclipse.remote.core.exception.RemoteConnectionException;
public class RDTProxyManager implements IRemoteEnvProxyManager {
@@ -55,8 +56,7 @@ public class RDTProxyManager implements IRemoteEnvProxyManager {
@Override
public String getOS(URI uri) {
- IRemoteServices services = RemoteServices.getRemoteServices(uri);
- IRemoteConnection connection = services.getConnectionManager().getConnection(uri);
+ IRemoteConnection connection = getConnection(uri);
String os = connection.getProperty(IRemoteConnection.OS_NAME_PROPERTY);
if (os == null || os.isEmpty()) {
//FIXME: need better way to get this property
@@ -73,8 +73,7 @@ public class RDTProxyManager implements IRemoteEnvProxyManager {
@Override
public Map<String, String> getEnv(URI uri) {
- IRemoteServices services = RemoteServices.getRemoteServices(uri);
- IRemoteConnection connection = services.getConnectionManager().getConnection(uri);
+ IRemoteConnection connection = getConnection(uri);
if(!connection.isOpen()) {
try {
connection.open(null);
@@ -96,7 +95,8 @@ public class RDTProxyManager implements IRemoteEnvProxyManager {
Pattern functionPattern = Pattern.compile("(.+)\\(\\)=([\\(\\)\\s{].+[\n]*.+)"); //$NON-NLS-1$
Matcher m;
Map<String, String> envMap = new HashMap<>();
- Map<String, String> envTemp = connection.getEnv();
+ IRemoteProcessService ps = connection.getService(IRemoteProcessService.class);
+ Map<String, String> envTemp = ps.getEnv();
for (String key : envTemp.keySet()) {
String value = envTemp.get(key);
String env = key + "=" + value; //$NON-NLS-1$
@@ -114,4 +114,17 @@ public class RDTProxyManager implements IRemoteEnvProxyManager {
return getEnv(uri);
}
+ /**
+ * Get the remote connection
+ *
+ * @param uri any valid URI to remote
+ * @return a remote connection
+ *
+ * @since 1.2
+ */
+ public static IRemoteConnection getConnection(URI uri) {
+ IRemoteServicesManager sm = Activator.getService(IRemoteServicesManager.class);
+ IRemoteConnectionType ct = sm.getConnectionType(uri);
+ return ct.getConnection(uri);
+ }
}
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/.classpath b/profiling/org.eclipse.linuxtools.remote.proxy.tests/.classpath
new file mode 100644
index 0000000000..eca7bdba8f
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/.project b/profiling/org.eclipse.linuxtools.remote.proxy.tests/.project
new file mode 100644
index 0000000000..162d90221e
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.linuxtools.remote.proxy.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/.settings/org.eclipse.jdt.core.prefs b/profiling/org.eclipse.linuxtools.remote.proxy.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..0c68a61dca
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/META-INF/MANIFEST.MF b/profiling/org.eclipse.linuxtools.remote.proxy.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..f58253d600
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Remote proxy tests
+Bundle-SymbolicName: org.eclipse.linuxtools.remote.proxy.tests
+Bundle-Version: 1.0.0.qualifier
+Bundle-Vendor: Eclipse Eclipse Linux Tools
+Fragment-Host: org.eclipse.linuxtools.rdt.proxy
+Require-Bundle: org.eclipse.core.runtime,
+ org.junit;bundle-version="4.12.0",
+ org.eclipse.linuxtools.profiling.launch;bundle-version="3.2.0",
+ org.eclipse.linuxtools.ssh.proxy;bundle-version="1.1.0",
+ org.eclipse.linuxtools.profiling.launch.ui.rdt.proxy;bundle-version="1.1.0",
+ org.eclipse.remote.core;bundle-version="2.0.0",
+ org.eclipse.core.resources,
+ org.eclipse.linuxtools.profiling.tests;bundle-version="1.1.0",
+ org.eclipse.debug.core,
+ org.eclipse.cdt.core,
+ org.eclipse.core.filesystem,
+ org.eclipse.ptp.rdt.sync.core
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
+Bundle-ActivationPolicy: lazy
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/about.html b/profiling/org.eclipse.linuxtools.remote.proxy.tests/about.html
new file mode 100644
index 0000000000..c258ef55d8
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html> \ No newline at end of file
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/build.properties b/profiling/org.eclipse.linuxtools.remote.proxy.tests/build.properties
new file mode 100644
index 0000000000..a2cc566612
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/build.properties
@@ -0,0 +1,6 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ resources/
+src.includes = about.html
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.cproject b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.cproject
new file mode 100644
index 0000000000..ec990299a7
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.cproject
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.130856328">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.130856328" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.130856328" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.exe.debug.130856328." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.1331484855" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.1080451522" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
+ <builder buildPath="${workspace_loc:/localTestProject}/Debug" id="cdt.managedbuild.target.gnu.builder.exe.debug.2128490134" managedBuildOn="true" name="Gnu Make Builder.Debug" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.1122705529" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1300004218" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
+ <option id="gnu.cpp.compiler.exe.debug.option.optimization.level.804994518" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.exe.debug.option.debugging.level.436273988" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1567435405" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.1821724128" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.exe.debug.option.debugging.level.1879560526" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1428042812" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.493803632" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug">
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1861193797" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.1998562183" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.1648569079" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1509191246" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.exe.release.1202066822">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.1202066822" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.1202066822" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
+ <folderInfo id="cdt.managedbuild.config.gnu.exe.release.1202066822." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.759208223" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1895498273" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
+ <builder buildPath="${workspace_loc:/localTestProject}/Release" id="cdt.managedbuild.target.gnu.builder.exe.release.306242205" managedBuildOn="true" name="Gnu Make Builder.Release" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.340183984" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1647054403" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
+ <option id="gnu.cpp.compiler.exe.release.option.optimization.level.1162768978" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.exe.release.option.debugging.level.384525271" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.587496528" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.2048752440" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.exe.release.option.debugging.level.1501524340" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.364412376" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.149960876" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release">
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.27829205" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.1333261658" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.1531302794" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.818612616" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="localTestProject.cdt.managedbuild.target.gnu.exe.1734835554" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.130856328;cdt.managedbuild.config.gnu.exe.debug.130856328.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.1567435405;cdt.managedbuild.tool.gnu.c.compiler.input.1428042812">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.1202066822;cdt.managedbuild.config.gnu.exe.release.1202066822.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.587496528;cdt.managedbuild.tool.gnu.c.compiler.input.364412376">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+</cproject>
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.gitignore b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.gitignore
new file mode 100644
index 0000000000..3df573fe62
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.gitignore
@@ -0,0 +1 @@
+/Debug/
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.project b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.project
new file mode 100644
index 0000000000..bdf48a9fa3
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/.project
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>localTestProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+</projectDescription>
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/main.c b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/main.c
new file mode 100644
index 0000000000..0a95e3ebc6
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/localTestProject/main.c
@@ -0,0 +1,11 @@
+/*
+ * main.c
+ *
+ * Created on: May 27, 2015
+ * Author: wainersm
+ */
+#include <stdio.h>
+int main() {
+ printf("Hello local test project\n");
+ return 0;
+}
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.cproject b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.cproject
new file mode 100644
index 0000000000..199aa18aa2
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.cproject
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
+ <storageModule moduleId="org.eclipse.cdt.core.settings">
+ <cconfiguration id="cdt.managedbuild.config.gnu.exe.debug.875510906">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.debug.875510906" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.debug.875510906" name="Debug" parent="cdt.managedbuild.config.gnu.exe.debug">
+ <folderInfo id="cdt.managedbuild.config.gnu.exe.debug.875510906." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.exe.debug.2128199" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.debug">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.debug.747884467" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.debug"/>
+ <builder buildPath="${workspace_loc:/syncTestProject}/Debug" id="cdt.managedbuild.target.gnu.builder.exe.debug.1848705522" managedBuildOn="true" name="Gnu Make Builder.Debug" superClass="cdt.managedbuild.target.gnu.builder.exe.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.1545994611" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug.1649860239" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.debug">
+ <option id="gnu.cpp.compiler.exe.debug.option.optimization.level.1479743334" superClass="gnu.cpp.compiler.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.exe.debug.option.debugging.level.1360175511" superClass="gnu.cpp.compiler.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.debug.432447017" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.debug">
+ <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.exe.debug.option.optimization.level.807223536" superClass="gnu.c.compiler.exe.debug.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.exe.debug.option.debugging.level.1769713026" superClass="gnu.c.compiler.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.839536717" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.debug.305648366" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.debug">
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.421320328" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug.1681701761" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.debug"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.exe.debug.235456711" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.debug">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.332014979" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+ </cconfiguration>
+ <cconfiguration id="cdt.managedbuild.config.gnu.exe.release.617757963">
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.exe.release.617757963" moduleId="org.eclipse.cdt.core.settings" name="Release">
+ <externalSettings/>
+ <extensions>
+ <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+ <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+ <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+ </extensions>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.exe.release.617757963" name="Release" parent="cdt.managedbuild.config.gnu.exe.release">
+ <folderInfo id="cdt.managedbuild.config.gnu.exe.release.617757963." name="/" resourcePath="">
+ <toolChain id="cdt.managedbuild.toolchain.gnu.exe.release.1437421543" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.exe.release">
+ <targetPlatform id="cdt.managedbuild.target.gnu.platform.exe.release.1662088101" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.exe.release"/>
+ <builder buildPath="${workspace_loc:/syncTestProject}/Release" id="cdt.managedbuild.target.gnu.builder.exe.release.1941213528" managedBuildOn="true" name="Gnu Make Builder.Release" superClass="cdt.managedbuild.target.gnu.builder.exe.release"/>
+ <tool id="cdt.managedbuild.tool.gnu.archiver.base.1955795129" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release.1845067470" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.exe.release">
+ <option id="gnu.cpp.compiler.exe.release.option.optimization.level.1587088754" superClass="gnu.cpp.compiler.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+ <option id="gnu.cpp.compiler.exe.release.option.debugging.level.1358495760" superClass="gnu.cpp.compiler.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.compiler.exe.release.106126950" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.exe.release">
+ <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.exe.release.option.optimization.level.376737548" superClass="gnu.c.compiler.exe.release.option.optimization.level" valueType="enumerated"/>
+ <option id="gnu.c.compiler.exe.release.option.debugging.level.1749017972" superClass="gnu.c.compiler.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
+ <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.313855453" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.c.linker.exe.release.828691930" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.exe.release">
+ <inputType id="cdt.managedbuild.tool.gnu.c.linker.input.195815306" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
+ <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+ <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+ </inputType>
+ </tool>
+ <tool id="cdt.managedbuild.tool.gnu.cpp.linker.exe.release.2039102456" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.exe.release"/>
+ <tool id="cdt.managedbuild.tool.gnu.assembler.exe.release.796281479" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.exe.release">
+ <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1783675008" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+ </tool>
+ </toolChain>
+ </folderInfo>
+ </configuration>
+ </storageModule>
+ </cconfiguration>
+ </storageModule>
+ <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+ <project id="syncTestProject.cdt.managedbuild.target.gnu.exe.826302240" name="Executable" projectType="cdt.managedbuild.target.gnu.exe"/>
+ </storageModule>
+ <storageModule moduleId="scannerConfiguration">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.debug.875510906;cdt.managedbuild.config.gnu.exe.debug.875510906.;cdt.managedbuild.tool.gnu.c.compiler.exe.debug.432447017;cdt.managedbuild.tool.gnu.c.compiler.input.839536717">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ <scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.exe.release.617757963;cdt.managedbuild.config.gnu.exe.release.617757963.;cdt.managedbuild.tool.gnu.c.compiler.exe.release.106126950;cdt.managedbuild.tool.gnu.c.compiler.input.313855453">
+ <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+ </scannerConfigBuildInfo>
+ </storageModule>
+ <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+</cproject>
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.gitignore b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.gitignore
new file mode 100644
index 0000000000..3df573fe62
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.gitignore
@@ -0,0 +1 @@
+/Debug/
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.project b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.project
new file mode 100644
index 0000000000..977f5df3ae
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/.project
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>syncTestProject</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+ <triggers>clean,full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+ <triggers>full,incremental,</triggers>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.cdt.core.cnature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+ <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+ </natures>
+</projectDescription>
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/main.c b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/main.c
new file mode 100644
index 0000000000..d9ccb36a4c
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/resources/syncTestProject/main.c
@@ -0,0 +1,7 @@
+#include<stdio.h>
+int main() {
+ printf("Hello sync project test");
+ return 0;
+}
+
+
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/AbstractProxyTest.java b/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/AbstractProxyTest.java
new file mode 100644
index 0000000000..32d9504ee3
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/AbstractProxyTest.java
@@ -0,0 +1,92 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation.
+ * 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:
+ * Wainer dos Santos Moschetta (IBM Corporation) - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.remote.proxy.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.fail;
+
+import org.eclipse.cdt.core.model.ICProject;
+import org.eclipse.cdt.utils.Platform;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.linuxtools.profiling.launch.RemoteProxyManager;
+import org.eclipse.linuxtools.profiling.tests.AbstractRemoteTest;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.eclipse.remote.core.exception.RemoteConnectionException;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.runner.RunWith;
+import org.junit.runners.JUnit4;
+
+@RunWith(JUnit4.class)
+public abstract class AbstractProxyTest extends AbstractRemoteTest {
+ protected static RemoteProxyManager proxyManager;
+ protected static final String CONNECTION_NAME = "test_connection";
+ protected static IRemoteConnection connection = null;
+ protected IProject localProject = null;
+ protected IProject syncProject = null;
+ protected final String PLUGIN = "org.eclipse.linuxtools.remote.proxy.tests";
+
+ @Before
+ public void setUp() throws RemoteConnectionException {
+ proxyManager = RemoteProxyManager.getInstance();
+ assertNotNull("RemoteProxyManager object should not be null", proxyManager);
+ if(connection == null) {
+ connection = createJSchConnection(CONNECTION_NAME, CONNECTION_TYPE_JSCH);
+ }
+ createTestProjects();
+ }
+
+ @AfterClass
+ public static void tearDown() throws RemoteConnectionException {
+ if(connection != null) {
+ deleteConnection(connection);
+ }
+ }
+
+ @Override
+ protected ILaunchConfigurationType getLaunchConfigType() {
+ // This testsuite does not care about LaunchConfig
+ return null;
+ }
+
+ @Override
+ protected void setProfileAttributes(ILaunchConfigurationWorkingCopy wc) throws CoreException {
+ // Do nothing. This testsuite does not care about LaunchConfig
+ }
+
+ protected void createTestProjects() {
+ ICProject project = null;
+ if (localProject == null) {
+ try {
+ project = createProject(Platform.getBundle(PLUGIN), "localTestProject");
+ } catch (Exception e) {
+ fail("Failed to create local project for the tests: " + e.getMessage());
+ }
+ localProject = project.getProject();
+ assertNotNull(localProject);
+ }
+
+ if (syncProject == null) {
+ try {
+ project = createProject(Platform.getBundle(PLUGIN), "syncTestProject");
+ convertToSyncProject(project.getProject(), connection, "/tmp/" + PLUGIN);
+ } catch (Exception e) {
+ fail("Failed to create synchronized project for the tests: " + e.getMessage());
+ }
+ syncProject = project.getProject();
+ assertNotNull(syncProject);
+ }
+ }
+}
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/CommandLauncherProxyTest.java b/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/CommandLauncherProxyTest.java
new file mode 100644
index 0000000000..12083aa6a8
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/CommandLauncherProxyTest.java
@@ -0,0 +1,145 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation.
+ * 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:
+ * Wainer dos Santos Moschetta (IBM Corporation) - initial implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.remote.proxy.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Map.Entry;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.linuxtools.internal.profiling.launch.LocalLauncher;
+import org.eclipse.linuxtools.internal.rdt.proxy.RDTCommandLauncher;
+import org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher;
+import org.junit.Test;
+
+@SuppressWarnings("restriction")
+public class CommandLauncherProxyTest extends AbstractProxyTest {
+ @Test
+ public void testRemoteCommandLauncher() {
+ IRemoteCommandLauncher cl = null;
+ Process p = null;
+ IPath commandPath, changeToDirectory;
+ String[] args, env;
+ try {
+ cl = proxyManager.getLauncher(syncProject);
+ assertTrue("Should have returned a remote launcher", cl instanceof RDTCommandLauncher);
+ } catch (CoreException e) {
+ fail("Should have returned a launcher: " + e.getCause());
+ }
+
+ commandPath = new Path("uptime");
+ args = new String[]{"-s"};
+ env = new String[]{"PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin"};
+ changeToDirectory = new Path("/tmp");
+ try {
+ p = cl.execute(commandPath, args, env, changeToDirectory, new NullProgressMonitor());
+ p.waitFor();
+ assertNotNull(p);
+ assertEquals("Process exited with failure", 0, p.exitValue());
+ } catch (Exception e) {
+ fail("Unable to execute " + commandPath + " on remote machine: " + e.getMessage());
+ }
+ InputStream actualIS = p.getInputStream();
+ int v = -1;
+ try {
+ v = actualIS.read();
+ } catch (IOException e) {
+ fail("Failed to read output of command executed remotely: " + e.getMessage());
+ }
+ // Ensure something can be read
+ assertTrue(v != -1);
+ }
+
+ @Test
+ public void testLocalCommandLauncher() {
+ IRemoteCommandLauncher cl = null;
+ Process p = null;
+ InputStream actualIS = null, expectedIS = null;
+ IPath commandPath, changeToDirectory;
+ String[] args, env;
+ try {
+ cl = proxyManager.getLauncher(localProject);
+ assertTrue("Should have returned a local launcher", cl instanceof LocalLauncher);
+ } catch (CoreException e) {
+ fail("Should have returned a launcher: " + e.getCause());
+ }
+ /*
+ * Prepare arguments for the test
+ */
+ commandPath = new Path("/bin/uptime");
+ args = new String[]{"-s"};
+ StringBuilder fullCmd = new StringBuilder();
+ fullCmd.append(commandPath.toOSString());
+ for(String s: args) {
+ fullCmd.append(" " + s);
+ }
+ // Use local env variables
+ ArrayList<String> envList = new ArrayList<String>();
+ for(Entry<String, String> entry : System.getenv().entrySet()) {
+ envList.add(entry.getKey()+"="+entry.getValue());
+ }
+ env = envList.toArray(new String[]{});
+ changeToDirectory = new Path("/tmp");
+
+ /*
+ * Run and get results using the proxy
+ */
+ try {
+ p = cl.execute(commandPath, args, env, changeToDirectory, new NullProgressMonitor());
+ assertNotNull(p);
+ while(p.isAlive());
+ // Call to waitFor() will drive to empty result
+ //p.waitFor();
+ assertEquals("Process exited with failure", 0, p.exitValue());
+ } catch (Exception e) {
+ fail("Unable to execute " + fullCmd.toString() + " on local machine: " + e.getMessage());
+ }
+
+ actualIS = p.getInputStream();
+ assertNotNull(actualIS);
+
+ /*
+ * Run and get results using java Runtime
+ */
+ try {
+ Process expectedProcess = Runtime.getRuntime().exec(fullCmd.toString());
+ expectedProcess.waitFor();
+ expectedIS = expectedProcess.getInputStream();
+ assertNotNull(expectedIS);
+ } catch (Exception e) {
+ fail("Unable to execute " + fullCmd.toString() + " on local using Runtime.exec: " + e.getMessage());
+ }
+
+ /*
+ * Finally compare results obtained
+ */
+ int va=0, ve=0;
+
+ do {
+ try {
+ va = actualIS.read();
+ ve = expectedIS.read();
+ } catch (IOException e) {
+ fail("Unable to read from Input Stream: " + e.getMessage());
+ }
+ assertEquals("Local proxy command output differs from Runtime.exec", ve, va);
+ } while(va != -1);
+ }
+}
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/FileProxyTest.java b/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/FileProxyTest.java
new file mode 100644
index 0000000000..636386b70f
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/FileProxyTest.java
@@ -0,0 +1,128 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation.
+ * 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:
+ * Wainer dos Santos Moschetta (IBM Corporation) - initial implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.remote.proxy.tests;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.internal.profiling.launch.LocalFileProxy;
+import org.eclipse.linuxtools.internal.rdt.proxy.RDTFileProxy;
+import org.eclipse.linuxtools.profiling.launch.IRemoteFileProxy;
+import org.eclipse.ptp.rdt.sync.core.SyncConfig;
+import org.eclipse.ptp.rdt.sync.core.exceptions.MissingConnectionException;
+import org.eclipse.remote.core.IRemoteConnection;
+import org.junit.Test;
+
+@SuppressWarnings("restriction")
+public class FileProxyTest extends AbstractProxyTest {
+
+ @Test
+ public void testRemoteFileProxyOnSyncProject() {
+ IRemoteFileProxy fileProxy = null;
+ try {
+ fileProxy = proxyManager.getFileProxy(syncProject);
+ assertTrue("Should have returned a remote launcher", fileProxy instanceof RDTFileProxy);
+ } catch (CoreException e) {
+ fail("Should have returned a launcher: " + e.getCause());
+ }
+ String ds = fileProxy.getDirectorySeparator();
+ assertNotNull(ds);
+
+ SyncConfig config = getSyncConfig(syncProject);
+ String projectLocation = config.getLocation();
+ assertNotNull(projectLocation);
+ IRemoteConnection conn = null;
+ String connScheme = null;
+ try {
+ conn = config.getRemoteConnection();
+ connScheme = conn.getConnectionType().getScheme();
+ } catch (MissingConnectionException e) {
+ fail("Unabled to get remote connection: " + e.getMessage());
+ }
+
+ /*
+ * Test getResource()
+ */
+ IFileStore fs = fileProxy.getResource(projectLocation);
+ assertNotNull(fs);
+ assertEquals("Remote connection and FileStore schemes diverge", connScheme, fs.toURI().getScheme());
+ //assertTrue(fs.fetchInfo().isDirectory());
+
+ /*
+ * Test getWorkingDir()
+ */
+ URI workingDir = fileProxy.getWorkingDir();
+ assertNotNull(workingDir);
+ assertEquals("Remote connection and URI schemes diverge", connScheme, workingDir.getScheme());
+
+ /*
+ * Test toPath()
+ */
+ URI uri = null;
+ try {
+ uri = new URI(connScheme, conn.getName(), projectLocation, null, null);
+ } catch (URISyntaxException e) {
+ fail("Failed to build URI for the test: " + e.getMessage());
+ }
+ assertEquals(projectLocation, fileProxy.toPath(uri));
+ }
+
+ @Test
+ public void testLocalFileProxy() {
+ IRemoteFileProxy fileProxy = null;
+ try {
+ fileProxy = proxyManager.getFileProxy(localProject);
+ assertTrue("Should have returned a remote launcher", fileProxy instanceof LocalFileProxy);
+ } catch (CoreException e) {
+ fail("Should have returned a launcher: " + e.getCause());
+ }
+
+ /*
+ * Test getDirectorySeparator()
+ */
+ String ds = fileProxy.getDirectorySeparator();
+ assertNotNull(ds);
+ /*
+ * Test getResource()
+ */
+ IFileStore actualFileStore = fileProxy.getResource(localProject.getLocation().toOSString());
+ assertNotNull(actualFileStore);
+
+ IFileStore expectedFileStore = null;
+ try {
+ expectedFileStore = EFS.getStore(localProject.getLocationURI());
+ } catch (CoreException e) {
+ fail("Unabled to get FileStore to local project: " + e.getMessage());
+ }
+ assertEquals("FileStore to local project folder diverge", expectedFileStore, actualFileStore);
+ assertTrue(actualFileStore.fetchInfo().isDirectory());
+
+ /*
+ * Test getWorkingDir()
+ */
+ URI workingDir = fileProxy.getWorkingDir();
+ assertNotNull(workingDir);
+ assertEquals(localProject.getLocationURI(), workingDir);
+
+ /*
+ * Test toPath()
+ */
+ assertEquals(localProject.getLocation().toOSString(), fileProxy.toPath(localProject.getLocationURI()));
+ }
+}
diff --git a/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/RemoteProxyManagerTest.java b/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/RemoteProxyManagerTest.java
new file mode 100644
index 0000000000..8418eec03c
--- /dev/null
+++ b/profiling/org.eclipse.linuxtools.remote.proxy.tests/src/org/eclipse/linuxtools/remote/proxy/tests/RemoteProxyManagerTest.java
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2015 IBM Corporation.
+ * 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:
+ * Wainer dos Santos Moschetta (IBM Corporation) - initial implementation
+ *******************************************************************************/
+package org.eclipse.linuxtools.remote.proxy.tests;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.net.URI;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.linuxtools.internal.profiling.launch.LocalFileProxy;
+import org.eclipse.linuxtools.internal.profiling.launch.LocalLauncher;
+import org.eclipse.linuxtools.internal.rdt.proxy.RDTCommandLauncher;
+import org.eclipse.linuxtools.internal.rdt.proxy.RDTFileProxy;
+import org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher;
+import org.eclipse.linuxtools.profiling.launch.IRemoteFileProxy;
+import org.eclipse.linuxtools.profiling.launch.RemoteConnection;
+import org.eclipse.ptp.rdt.sync.core.RemoteLocation;
+import org.eclipse.ptp.rdt.sync.core.SyncConfig;
+
+@SuppressWarnings("restriction")
+public class RemoteProxyManagerTest extends AbstractProxyTest {
+
+ @Test
+ public void testGetFileProxy() {
+ IRemoteFileProxy fp;
+ try {
+ /*
+ * Test the proxy for local URIs and project
+ */
+ fp = proxyManager.getFileProxy(URI.create("/path/to/file"));
+ assertTrue("Should return a local file proxy", fp instanceof LocalFileProxy);
+ fp = proxyManager.getFileProxy(URI.create("file:/path/to/file"));
+ assertTrue("Should return a local file proxy", fp instanceof LocalFileProxy);
+ fp = proxyManager.getFileProxy(localProject.getLocationURI());
+ assertTrue("Should return a local file proxy", fp instanceof LocalFileProxy);
+ fp = proxyManager.getFileProxy(localProject.getProject());
+ assertTrue("Should return a local file proxy", fp instanceof LocalFileProxy);
+ /*
+ * Test the proxy for remote URIs and project
+ */
+ fp = proxyManager.getFileProxy(URI.create("ssh://" + CONNECTION_NAME + "/path/to/file"));
+ assertTrue("Should have returned a remote file proxy", fp instanceof RDTFileProxy);
+ fp = proxyManager.getFileProxy(syncProject.getProject());
+ assertTrue("Should have returned a remote file proxy", fp instanceof RDTFileProxy);
+ } catch (CoreException e) {
+ fail("Should have returned a file proxy: " + e.getCause());
+ }
+
+ /*
+ * Test the proxy for unsupported URIs
+ */
+ try {
+ // As of org.eclipse.remote 2.0, remotetools scheme is no longer
+ // support
+ fp = proxyManager.getFileProxy(URI.create("remotetools://MyConnection/path/to/file"));
+ fail("remotetools scheme should not be recognized");
+ } catch (CoreException e) {
+ assertTrue(true);
+ }
+ }
+
+ @Test
+ public void testGetLauncher() {
+ IRemoteCommandLauncher cl;
+ try {
+ /*
+ * Test launcher got for local URIs and project
+ */
+ cl = proxyManager.getLauncher(localProject.getLocationURI());
+ assertTrue("Should have returned a local launcher", cl instanceof LocalLauncher);
+ cl = proxyManager.getLauncher(localProject);
+ assertTrue("Should have returned a local launcher", cl instanceof LocalLauncher);
+ /*
+ * Test launcher got for remote project and URI
+ */
+ cl = proxyManager.getLauncher(URI.create("ssh://" + CONNECTION_NAME + "/path/to/file"));
+ assertTrue("Should have returned a remote file proxy", cl instanceof RDTCommandLauncher);
+ cl = proxyManager.getLauncher(syncProject);
+ assertTrue("Should have returned a remote launcher", cl instanceof RDTCommandLauncher);
+ } catch (CoreException e) {
+ fail("Should have returned a launcher: " + e.getCause());
+ }
+
+ /*
+ * Test the proxy for unsupported URIs
+ */
+ try {
+ // As of org.eclipse.remote 2.0, remotetools scheme is no longer
+ // support
+ cl = proxyManager.getLauncher(URI.create("remotetools://MyConnection/path/to/file"));
+ fail("remotetools scheme should not be recognized");
+ } catch (CoreException e) {
+ assertTrue(true);
+ }
+ }
+
+ @Test
+ public void testGetOS() {
+ String actualOS = null;
+ try {
+ /*
+ * Test got OS for local URIs and project
+ */
+ actualOS = proxyManager.getOS(URI.create("/path/to/file"));
+ assertNotNull(actualOS);
+ assertTrue("Should have returned the OS name", !actualOS.isEmpty());
+ actualOS = proxyManager.getOS(URI.create("file:/path/to/file"));
+ assertNotNull(actualOS);
+ assertTrue("Should have returned the OS name", !actualOS.isEmpty());
+ actualOS = proxyManager.getOS(localProject.getLocationURI());
+ assertNotNull(actualOS);
+ assertTrue("Should have returned the OS name", !actualOS.isEmpty());
+ actualOS = proxyManager.getOS(localProject);
+ assertNotNull(actualOS);
+ assertTrue("Should have returned the OS name", !actualOS.isEmpty());
+ /*
+ * Test got OS for remote URIs and project
+ */
+ actualOS = proxyManager.getOS(syncProject);
+ assertNotNull(actualOS);
+ assertTrue("Should have returned the OS name", !actualOS.isEmpty());
+ } catch (CoreException e) {
+ fail("Unabled to get OS name: " + e.getMessage());
+ }
+
+ /*
+ * Test the proxy for unsupported URIs
+ */
+ try {
+ // As of org.eclipse.remote 2.0, remotetools scheme is no longer
+ // support
+ actualOS = proxyManager.getOS(URI.create("remotetools://MyConnection/path/to/file"));
+ fail("remotetools scheme should not be recognized");
+ } catch (CoreException e) {
+ assertTrue(true);
+ }
+ }
+
+ @Test
+ public void testGetRemoteProjectLocationOnSyncProj() {
+ try {
+ String actualLocation = proxyManager.getRemoteProjectLocation(syncProject);
+ SyncConfig config = getSyncConfig(syncProject);
+ assertNotNull(config);
+ assertEquals(this.connection.getConnectionType().getScheme(), URI.create(actualLocation).getScheme());
+ assertEquals(config.getConnectionName(), URI.create(actualLocation).getAuthority());
+ assertEquals(config.getLocation(),URI.create(actualLocation).getPath());
+ } catch (CoreException e) {
+ fail("Should have returned the remote project location: " + e.getMessage());
+ }
+ }
+}
diff --git a/releng/org.eclipse.linuxtools.target/linuxtools-e4.5.target b/releng/org.eclipse.linuxtools.target/linuxtools-e4.5.target
index 4033087ff5..96975e1b3d 100644
--- a/releng/org.eclipse.linuxtools.target/linuxtools-e4.5.target
+++ b/releng/org.eclipse.linuxtools.target/linuxtools-e4.5.target
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.8"?><target name="linuxtools-e4.5" sequenceNumber="30">
+<?pde version="3.8"?><target name="linuxtools-e4.5" sequenceNumber="32">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.swtchart" version="0.0.0"/>
@@ -27,8 +27,15 @@
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.ptp.rdt.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tools/ptp/builds/mars/milestones"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.ptp.rdt.sync.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/tools/ptp/builds/mars/milestones"/>
+</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.remote.feature.group" version="0.0.0"/>
-<repository location="http://download.eclipse.org/tools/ptp/updates/luna"/>
+<repository location="http://download.eclipse.org/tools/ptp/builds/remote/mars/milestones"/>
</location>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.swtbot.eclipse.feature.group" version="0.0.0"/>
@@ -43,6 +50,10 @@
<unit id="org.eclipse.zest.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/tools/gef/updates/releases/"/>
</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.eclipse.jgit.feature.group" version="0.0.0"/>
+<repository location="http://download.eclipse.org/egit/staging/v4.0.0.201505260635-rc2/"/>
+</location>
</locations>
<targetJRE path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<launcherArgs>

Back to the top