mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-19 14:15:50 +02:00
[168810] Add testsubsystem access to IRSEConnectionManager
This commit is contained in:
parent
d4de109d0a
commit
785457e714
2 changed files with 35 additions and 7 deletions
|
@ -13,7 +13,9 @@ import java.util.Properties;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.rse.core.model.IHost;
|
import org.eclipse.rse.core.model.IHost;
|
||||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem;
|
||||||
|
import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
|
||||||
|
import org.eclipse.rse.tests.testsubsystem.interfaces.ITestSubSystem;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interfaces declares public access and factory methods to deal
|
* Interfaces declares public access and factory methods to deal
|
||||||
|
@ -87,7 +89,7 @@ public interface IRSEConnectionManager {
|
||||||
*
|
*
|
||||||
* @throws Exception If the file subsystem lookup fails.
|
* @throws Exception If the file subsystem lookup fails.
|
||||||
*/
|
*/
|
||||||
public ISubSystem getFileSubSystem(IHost connection, String desiredConfigurationId) throws Exception;
|
public FileServiceSubSystem getFileSubSystem(IHost connection, String desiredConfigurationId) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the shell subsystem for the specified connection.
|
* Get the shell subsystem for the specified connection.
|
||||||
|
@ -97,6 +99,16 @@ public interface IRSEConnectionManager {
|
||||||
*
|
*
|
||||||
* @throws Exception If the shell subsystem lookup fails.
|
* @throws Exception If the shell subsystem lookup fails.
|
||||||
*/
|
*/
|
||||||
public ISubSystem getShellSubSystem(IHost connection) throws Exception;
|
public IShellServiceSubSystem getShellSubSystem(IHost connection) throws Exception;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the testsubsystem for the specified connection.
|
||||||
|
*
|
||||||
|
* @param connection The corresponding <code>IHost</code> connection object. Must be not <code>null</code>.
|
||||||
|
* @return The testsubsystem object if found or <code>null</code>.
|
||||||
|
*
|
||||||
|
* @throws Exception If the testsubsystem lookup fails.
|
||||||
|
*/
|
||||||
|
public ITestSubSystem getTestSubSystem(IHost connection) throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,7 @@ import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShell
|
||||||
import org.eclipse.rse.tests.RSETestsPlugin;
|
import org.eclipse.rse.tests.RSETestsPlugin;
|
||||||
import org.eclipse.rse.tests.core.connection.IRSEConnectionManager;
|
import org.eclipse.rse.tests.core.connection.IRSEConnectionManager;
|
||||||
import org.eclipse.rse.tests.core.connection.IRSEConnectionProperties;
|
import org.eclipse.rse.tests.core.connection.IRSEConnectionProperties;
|
||||||
|
import org.eclipse.rse.tests.testsubsystem.interfaces.ITestSubSystem;
|
||||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||||
import org.osgi.framework.Bundle;
|
import org.osgi.framework.Bundle;
|
||||||
|
|
||||||
|
@ -244,7 +245,7 @@ public class RSEConnectionManager implements IRSEConnectionManager {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.tests.core.connection.IRSEConnectionManager#getFileSubSystem(org.eclipse.rse.core.model.IHost, java.lang.String)
|
* @see org.eclipse.rse.tests.core.connection.IRSEConnectionManager#getFileSubSystem(org.eclipse.rse.core.model.IHost, java.lang.String)
|
||||||
*/
|
*/
|
||||||
public ISubSystem getFileSubSystem(IHost connection, String desiredConfigurationId) throws Exception {
|
public FileServiceSubSystem getFileSubSystem(IHost connection, String desiredConfigurationId) throws Exception {
|
||||||
assert connection != null && desiredConfigurationId != null;
|
assert connection != null && desiredConfigurationId != null;
|
||||||
FileServiceSubSystem subsystem = (FileServiceSubSystem)RemoteFileUtility.getFileSubSystem(connection);
|
FileServiceSubSystem subsystem = (FileServiceSubSystem)RemoteFileUtility.getFileSubSystem(connection);
|
||||||
ISubSystemConfiguration config = subsystem.getSubSystemConfiguration();
|
ISubSystemConfiguration config = subsystem.getSubSystemConfiguration();
|
||||||
|
@ -267,15 +268,30 @@ public class RSEConnectionManager implements IRSEConnectionManager {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.tests.core.connection.IRSEConnectionManager#getShellSubSystem(org.eclipse.rse.core.model.IHost)
|
* @see org.eclipse.rse.tests.core.connection.IRSEConnectionManager#getShellSubSystem(org.eclipse.rse.core.model.IHost)
|
||||||
*/
|
*/
|
||||||
public ISubSystem getShellSubSystem(IHost connection) throws Exception {
|
public IShellServiceSubSystem getShellSubSystem(IHost connection) throws Exception {
|
||||||
assert connection != null;
|
assert connection != null;
|
||||||
ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
|
ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
|
||||||
ISubSystem[] subSystems = registry.getSubSystems(connection);
|
ISubSystem[] subSystems = registry.getSubSystems(connection);
|
||||||
for (int i = 0; i < subSystems.length; i++) {
|
for (int i = 0; i < subSystems.length; i++) {
|
||||||
ISubSystem subSystem = subSystems[i];
|
ISubSystem subSystem = subSystems[i];
|
||||||
if (subSystem instanceof IShellServiceSubSystem) {
|
if (subSystem instanceof IShellServiceSubSystem) {
|
||||||
IShellServiceSubSystem shellSubSystem = (IShellServiceSubSystem)subSystem;
|
return (IShellServiceSubSystem)subSystem;
|
||||||
return shellSubSystem;
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.rse.tests.core.connection.IRSEConnectionManager#getTestSubSystem(org.eclipse.rse.core.model.IHost)
|
||||||
|
*/
|
||||||
|
public ITestSubSystem getTestSubSystem(IHost connection) throws Exception {
|
||||||
|
assert connection != null;
|
||||||
|
ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry();
|
||||||
|
ISubSystem[] subSystems = registry.getSubSystems(connection);
|
||||||
|
for (int i = 0; i < subSystems.length; i++) {
|
||||||
|
ISubSystem subSystem = subSystems[i];
|
||||||
|
if (subSystem instanceof ITestSubSystem) {
|
||||||
|
return (ITestSubSystem)subSystem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Add table
Reference in a new issue