From e36c358ab1d0bcb204dc0dc6518d5f685ee4b448 Mon Sep 17 00:00:00 2001 From: Martin Oberhuber < martin.oberhuber@windriver.com> Date: Fri, 11 May 2007 15:15:31 +0000 Subject: [PATCH] [185098][api] Provide constants for all well-known system types --- .../rse/internal/discovery/ServiceDiscoveryWizard.java | 2 +- .../src/org/eclipse/rse/core/IRSESystemType.java | 10 ++++++++++ .../tests/internal/RSEInternalFrameworkTestCase.java | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/discovery/org.eclipse.rse.discovery/src/org/eclipse/rse/internal/discovery/ServiceDiscoveryWizard.java b/discovery/org.eclipse.rse.discovery/src/org/eclipse/rse/internal/discovery/ServiceDiscoveryWizard.java index 5041d41351f..492d329aa06 100644 --- a/discovery/org.eclipse.rse.discovery/src/org/eclipse/rse/internal/discovery/ServiceDiscoveryWizard.java +++ b/discovery/org.eclipse.rse.discovery/src/org/eclipse/rse/internal/discovery/ServiceDiscoveryWizard.java @@ -105,7 +105,7 @@ public class ServiceDiscoveryWizard extends Wizard { IHost conn = null; try { - IRSESystemType discoveryType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById("org.eclipse.rse.systemtype.discovery"); //$NON-NLS-1$ + IRSESystemType discoveryType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_DISCOVERY_ID); conn = registry.createHost(discoveryType, "Discovery@" + hostName, hostName, "Discovered services in "+hostName);//$NON-NLS-1$ //$NON-NLS-2$ } catch (Exception e) { RSEUIPlugin.getTheSystemRegistry().deleteHost(conn); diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java index 2bdc9c7a9cf..1788e6bd050 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/IRSESystemType.java @@ -12,6 +12,7 @@ * * Contributors: * Uwe Stieber (Wind River) - Extended system type -> subsystemConfiguration association. + * Martin Oberhuber (Wind River) - [185098] Provide constants for all well-known system types ********************************************************************************/ package org.eclipse.rse.core; @@ -137,6 +138,15 @@ public interface IRSESystemType extends IAdaptable { */ public static final String SYSTEMTYPE_WINDOWS_ID = "org.eclipse.rse.systemtype.windows"; //$NON-NLS-1$ + /** Discovery system type, "org.eclipse.rse.systemtype.discovery". */ + public static final String SYSTEMTYPE_DISCOVERY_ID = "org.eclipse.rse.systemtype.discovery"; //$NON-NLS-1$ + /** FTP Only system type, "org.eclipse.rse.systemtype.ftp". */ + public static final String SYSTEMTYPE_FTP_ONLY_ID = "org.eclipse.rse.systemtype.ftp"; //$NON-NLS-1$ + /** SSH Only system type, "org.eclipse.rse.systemtype.ssh". */ + public static final String SYSTEMTYPE_SSH_ONLY_ID = "org.eclipse.rse.systemtype.ssh"; //$NON-NLS-1$ + /** Telnet Only system type, "org.eclipse.rse.systemtype.telnet". */ + public static final String SYSTEMTYPE_TELNET_ONLY_ID = "org.eclipse.rse.systemtype.telnet"; //$NON-NLS-1$ + /** * Returns the id of the system type. * @return the id of the system type diff --git a/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/internal/RSEInternalFrameworkTestCase.java b/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/internal/RSEInternalFrameworkTestCase.java index 3a6720b1afa..654d8f29400 100644 --- a/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/internal/RSEInternalFrameworkTestCase.java +++ b/rse/tests/org.eclipse.rse.tests/src/org/eclipse/rse/tests/internal/RSEInternalFrameworkTestCase.java @@ -189,14 +189,14 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase { // test the loading with partial connection information (with defauls) Properties props = new Properties(); - props.setProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID, "org.eclipse.rse.systemtype.ssh"); //$NON-NLS-1$ + props.setProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID, IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID); props.setProperty(IRSEConnectionProperties.ATTR_USERID, "local_user"); //$NON-NLS-1$ props.setProperty(IRSEConnectionProperties.ATTR_PASSWORD, "local_passwd"); //$NON-NLS-1$ properties = getConnectionManager().loadConnectionProperties(props, true); assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$ assertEquals("Property name does not match!", "Local", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$ assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ - assertEquals("Property system type does not match!", "org.eclipse.rse.systemtype.ssh", properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$ + assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property remote system address does not match!", "localhost", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$ @@ -206,7 +206,7 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase { assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$ assertNull("Property name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ - assertEquals("Property system type does not match!", "org.eclipse.rse.systemtype.ssh", properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$ + assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$ assertNull("Property remote system address does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$