Search in sources :

Example 1 with SSHCommandLauncher

use of org.eclipse.linuxtools.internal.ssh.proxy.SSHCommandLauncher in project linuxtools by eclipse.

the class RemoteProxyManagerTest method testGetLauncher.

@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.getProject());
        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.getProject());
        assertTrue("Should have returned a remote launcher", cl instanceof RDTCommandLauncher);
        /*
			 * Test launcher got for jsch scheme
			 */
        cl = proxyManager.getLauncher(URI.create("jsch://" + USERNAME + "@" + HOST + ":22/path/to/file"));
        assertTrue("Should have returned a remote file proxy", cl instanceof SSHCommandLauncher);
    } 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(e.getMessage(), true);
    }
}
Also used : LocalLauncher(org.eclipse.linuxtools.internal.profiling.launch.LocalLauncher) CoreException(org.eclipse.core.runtime.CoreException) SSHCommandLauncher(org.eclipse.linuxtools.internal.ssh.proxy.SSHCommandLauncher) IRemoteCommandLauncher(org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher) RDTCommandLauncher(org.eclipse.linuxtools.internal.rdt.proxy.RDTCommandLauncher) AbstractProxyTest(org.eclipse.linuxtools.remote.proxy.tests.AbstractProxyTest) Test(org.junit.Test)

Aggregations

CoreException (org.eclipse.core.runtime.CoreException)1 LocalLauncher (org.eclipse.linuxtools.internal.profiling.launch.LocalLauncher)1 RDTCommandLauncher (org.eclipse.linuxtools.internal.rdt.proxy.RDTCommandLauncher)1 SSHCommandLauncher (org.eclipse.linuxtools.internal.ssh.proxy.SSHCommandLauncher)1 IRemoteCommandLauncher (org.eclipse.linuxtools.profiling.launch.IRemoteCommandLauncher)1 AbstractProxyTest (org.eclipse.linuxtools.remote.proxy.tests.AbstractProxyTest)1 Test (org.junit.Test)1