1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-10 01:35:39 +02:00

Added a new property file for each type of connection(local, ftp, ssh, linux, windows).

Added a new property (daemon_port) to IRSEConnectionProperties.
This commit is contained in:
Kevin Doyle 2008-02-29 21:39:14 +00:00
parent 022347414f
commit 25d7060839
10 changed files with 342 additions and 123 deletions

View file

@ -23,6 +23,7 @@ public interface IRSEConnectionProperties {
public final String ATTR_ADDRESS = "address"; //$NON-NLS-1$
public final String ATTR_USERID = "userid"; //$NON-NLS-1$
public final String ATTR_PASSWORD = "password"; //$NON-NLS-1$
public final String ATTR_DAEMON_PORT = "daemon_port"; //$NON-NLS-1$
/**
* Returns the associated property stored under the specified key.

View file

@ -31,6 +31,7 @@ import junit.framework.Assert;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.PasswordPersistenceManager;
@ -41,6 +42,8 @@ import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemSignonInformation;
import org.eclipse.rse.core.subsystems.IRemoteServerLauncher;
import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.subsystems.files.core.model.RemoteFileUtility;
@ -50,6 +53,8 @@ import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.connection.IRSEConnectionManager;
import org.eclipse.rse.tests.core.connection.IRSEConnectionProperties;
import org.eclipse.rse.tests.testsubsystem.interfaces.ITestSubSystem;
import org.eclipse.rse.ui.ISystemPreferencesConstants;
import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.swt.widgets.Display;
import org.osgi.framework.Bundle;
@ -216,18 +221,20 @@ public class RSEConnectionManager implements IRSEConnectionManager {
Assert.assertNotNull("FAILED(findOrCreateConnection): Failed to find and/or create system profile '" + profileName + "'!", profile); //$NON-NLS-1$ //$NON-NLS-2$
String name = properties.getProperty(IRSEConnectionProperties.ATTR_NAME);
Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid host name!", "unknown", name); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("FAILED(findOrCreateConnection): Invalid host name!", "unknown".equals(name)); //$NON-NLS-1$ //$NON-NLS-2$
connection = systemRegistry.getHost(profile, name);
if (connection == null) {
String userId = properties.getProperty(IRSEConnectionProperties.ATTR_USERID);
Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid user id name!", "unknown", userId); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("FAILED(findOrCreateConnection): Invalid user id name!", "unknown".equals(userId)); //$NON-NLS-1$ //$NON-NLS-2$
String password = properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD);
Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid user password name!", "unknown", password); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("FAILED(findOrCreateConnection): Invalid user password name!", "unknown".equals(password)); //$NON-NLS-1$ //$NON-NLS-2$
String address = properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS);
Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid remote system ip address or dns name!", "unknown", address); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("FAILED(findOrCreateConnection): Invalid remote system ip address or dns name!", "unknown".equals(address)); //$NON-NLS-1$ //$NON-NLS-2$
String systemTypeId = properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID);
Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid system type!", "unknown", systemTypeId); //$NON-NLS-1$ //$NON-NLS-2$
Assert.assertFalse("FAILED(findOrCreateConnection): Invalid system type!", "unknown".equals(systemTypeId)); //$NON-NLS-1$ //$NON-NLS-2$
IRSESystemType systemType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(systemTypeId);
String daemonPort = properties.getProperty(IRSEConnectionProperties.ATTR_DAEMON_PORT);
Assert.assertFalse("FAILED(findOrCreateConnection): Invalid port!", "unknown".equals(daemonPort)); //$NON-NLS-1$ //$NON-NLS-2$
exception = null;
cause = null;
@ -244,6 +251,15 @@ public class RSEConnectionManager implements IRSEConnectionManager {
SystemSignonInformation info = new SystemSignonInformation(address, userId, password, systemType);
PasswordPersistenceManager.getInstance().add(info, true, true);
}
if (daemonPort != null) {
int daemonPortNum = Integer.parseInt(daemonPort);
IServerLauncherProperties connProperties = connection.getConnectorServices()[0].getRemoteServerLauncherProperties();
if (connProperties instanceof IRemoteServerLauncher) {
IRemoteServerLauncher launcher = (IRemoteServerLauncher) connProperties;
launcher.setDaemonPort(daemonPortNum);
}
}
}
Assert.assertNotNull("FAILED(findOrCreateConnection): Failed to find and/or create connection IHost object!", connection); //$NON-NLS-1$
final Display display = Display.getCurrent();

View file

@ -15,27 +15,24 @@
package org.eclipse.rse.tests.subsystems.files;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.internal.core.model.SystemRegistry;
import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.services.files.IHostFile;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.tests.core.connection.IRSEConnectionProperties;
import org.eclipse.rse.ui.ISystemPreferencesConstants;
import org.eclipse.rse.ui.RSEUIPlugin;
public class CreateFileTestCase extends FileServiceBaseTest {
private String SYSTEM_ADDRESS = "sles8rm";//"SLES8RM";
private String USER_ID = "xxxxxx";
private String PASSWORD = "xxxxxx"; //"xxxxxx";
private IHost host;
//TODO: See if additional characters in the name should work.
// Also make sure if there are that they can be entered in the New
@ -56,36 +53,30 @@ public class CreateFileTestCase extends FileServiceBaseTest {
return null;
}
protected IHost getSSHHost()
{
IHost sshHost = null;
public void testCreateFileFTP() throws Exception {
//-test-author-:KevinDoyle
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_ssh";
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("ftpConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
sshHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(sshHost);
return sshHost;
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
// Lookup and create the connection now if necessary
host = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), host); //$NON-NLS-1$
createFileAndAssertProperties();
}
protected IHost getFTPHost()
{
IHost ftpHost = null;
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_FTP_ONLY_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_ftp";
ftpHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(ftpHost);
return ftpHost;
}
protected IHost getDStoreHost()
{
IHost dstoreHost = null;
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_LINUX_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_dstore";
public void testCreateFileDStore() throws Exception {
//-test-author-:KevinDoyle
//Ensure that the SSL acknowledge dialog does not show up.
//We need to setDefault first in order to set the value of a preference.
@ -96,27 +87,44 @@ public class CreateFileTestCase extends FileServiceBaseTest {
store.setValue(ISystemPreferencesConstants.ALERT_SSL, false);
store.setValue(ISystemPreferencesConstants.ALERT_NONSSL, false);
dstoreHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(dstoreHost);
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("linuxConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
return dstoreHost;
}
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
public void testCreateFileFTP() throws Exception {
//-test-author-:KevinDoyle
host = getFTPHost();
createFileAndAssertProperties();
}
// Lookup and create the connection now if necessary
host = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), host); //$NON-NLS-1$
public void testCreateFileDStore() throws Exception {
//-test-author-:KevinDoyle
host = getDStoreHost();
createFileAndAssertProperties();
}
public void testCreateFileSSH() throws Exception {
//-test-author-:KevinDoyle
host = getSSHHost();
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("sshConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
// Lookup and create the connection now if necessary
host = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), host); //$NON-NLS-1$
createFileAndAssertProperties();
}
@ -157,7 +165,7 @@ public class CreateFileTestCase extends FileServiceBaseTest {
fss.disconnect();
tempDirectory = null;
}
SystemRegistry.getInstance().deleteHost(host);
getConnectionManager().removeConnection(host.getSystemProfile().getName(), host.getName());
host = null;
}
}

View file

@ -21,28 +21,25 @@ import java.net.URI;
import org.eclipse.core.filesystem.EFS;
import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.internal.core.model.SystemRegistry;
import org.eclipse.rse.internal.efs.RSEFileStore;
import org.eclipse.rse.services.clientserver.PathUtility;
import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.subsystems.files.core.servicesubsystem.FileServiceSubSystem;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.tests.core.connection.IRSEConnectionProperties;
import org.eclipse.rse.ui.ISystemPreferencesConstants;
import org.eclipse.rse.ui.RSEUIPlugin;
public class FileOutputStreamTestCase extends FileServiceBaseTest {
private String SYSTEM_ADDRESS = "sles8rm";//"SLES8RM";
private String USER_ID = "xxxxxx";
private String PASSWORD = "xxxxxx"; //"xxxxxx";
private IHost host = null;
private IRemoteFile tempDirectory;
@ -61,46 +58,68 @@ public class FileOutputStreamTestCase extends FileServiceBaseTest {
protected IHost getSSHHost()
{
IHost sshHost = null;
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("sshConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_ssh";
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
sshHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(sshHost);
return sshHost;
// Lookup and create the connection now if necessary
host = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), host); //$NON-NLS-1$
return host;
}
protected IHost getFTPHost()
{
IHost ftpHost = null;
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("ftpConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_FTP_ONLY_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_ftp";
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
ftpHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(ftpHost);
return ftpHost;
// Lookup and create the connection now if necessary
host = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), host); //$NON-NLS-1$
return host;
}
protected IHost getLocalHost() {
IHost localHost = null;
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("localConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_LOCAL_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_local";
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
localHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, "localhost", SYSTEM_NAME, "", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
assertNotNull(localHost);
return localHost;
// Lookup and create the connection now if necessary
host = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), host); //$NON-NLS-1$
return host;
}
protected IHost getDStoreHost()
{
IHost dstoreHost = null;
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_LINUX_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_dstore";
//Ensure that the SSL acknowledge dialog does not show up.
//We need to setDefault first in order to set the value of a preference.
IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
@ -110,10 +129,23 @@ public class FileOutputStreamTestCase extends FileServiceBaseTest {
store.setValue(ISystemPreferencesConstants.ALERT_SSL, false);
store.setValue(ISystemPreferencesConstants.ALERT_NONSSL, false);
dstoreHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(dstoreHost);
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("linuxConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
return dstoreHost;
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
// Lookup and create the connection now if necessary
host = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), host); //$NON-NLS-1$
return host;
}
public void testRSEFileStoreAppendOutputStreamLocal() throws Exception {
@ -265,7 +297,7 @@ public class FileOutputStreamTestCase extends FileServiceBaseTest {
fss.disconnect();
tempDirectory = null;
}
SystemRegistry.getInstance().deleteHost(host);
getConnectionManager().removeConnection(host.getSystemProfile().getName(), host.getName());
host = null;
}
}

View file

@ -17,10 +17,10 @@ import java.io.File;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemStartHere;
@ -29,6 +29,7 @@ import org.eclipse.rse.services.files.IFileService;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.connection.IRSEConnectionProperties;
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
import org.eclipse.rse.ui.ISystemPreferencesConstants;
import org.eclipse.rse.ui.RSEUIPlugin;
@ -42,19 +43,8 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
private List _connections;
private List _samplePaths;
private String SYSTEM_ADDRESS = "dmcknigh3";//"SLES8RM";
private String USER_ID = "dmcknigh";
private String PASSWORD = null;//"xxxxxx";
private String LOCALTEMPDIR = "C:\\temp";
/*
private SYSTEM_ADDRESS = "dmcknigh3";
private USER_ID = "tester";
private PASSWORD = null;"xxxxxx";
*/
/* (non-Javadoc)
* @see org.eclipse.rse.tests.core.RSECoreTestCase#tearDown()
*/
@ -134,11 +124,22 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
{
IHost sshHost = null;
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_ssh";
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("sshConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
// Lookup and create the connection now if necessary
sshHost = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), sshHost); //$NON-NLS-1$
sshHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(sshHost);
return sshHost;
}
@ -146,11 +147,22 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
{
IHost ftpHost = null;
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_FTP_ONLY_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_ftp";
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("ftpConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
// Lookup and create the connection now if necessary
ftpHost = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), ftpHost); //$NON-NLS-1$
ftpHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(ftpHost);
return ftpHost;
}
@ -158,9 +170,6 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
{
IHost dstoreHost = null;
String SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_LINUX_ID;
String SYSTEM_NAME = SYSTEM_ADDRESS + "_dstore";
//Ensure that the SSL acknowledge dialog does not show up.
//We need to setDefault first in order to set the value of a preference.
IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
@ -170,8 +179,21 @@ public class FileSubsystemConsistencyTestCase extends RSEBaseConnectionTestCase
store.setValue(ISystemPreferencesConstants.ALERT_SSL, false);
store.setValue(ISystemPreferencesConstants.ALERT_NONSSL, false);
dstoreHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, USER_ID, PASSWORD);
assertNotNull(dstoreHost);
// Calculate the location of the test connection properties
IPath location = getTestDataLocation("", false); //$NON-NLS-1$
assertNotNull("Cannot locate test data! Missing test data location?", location); //$NON-NLS-1$
location = location.append("linuxConnection.properties"); //$NON-NLS-1$
assertNotNull("Failed to construct location to 'connection.properties' test data file!", location); //$NON-NLS-1$
assertTrue("Required test data file seems to be not a file!", location.toFile().isFile()); //$NON-NLS-1$
assertTrue("Required test data file is not readable!", location.toFile().canRead()); //$NON-NLS-1$
// Load the properties from the calculated location without backing up defaults
IRSEConnectionProperties properties = getConnectionManager().loadConnectionProperties(location, false);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
// Lookup and create the connection now if necessary
dstoreHost = getConnectionManager().findOrCreateConnection(properties);
assertNotNull("Failed to create connection " + properties.getProperty(IRSEConnectionProperties.ATTR_NAME), dstoreHost); //$NON-NLS-1$
return dstoreHost;
}

View file

@ -0,0 +1,28 @@
###############################################################################
# Copyright (c) 2008 IBM Corporation and others. All rights reserved.
# 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:
# IBM Corporation - initial API and implementation
###############################################################################
# name/label for this ftp connection
name = test_ftp_only
# profile name this connection should be created for
profile_name = junit_test_profile
# FTP system ID
system_type_id = org.eclipse.rse.systemtype.ftp
# Address of ftp connection
address = unknown
# userid to connect to ftp connection
#userid =
# password to connect to ftp connection
#password =

View file

@ -0,0 +1,31 @@
###############################################################################
# Copyright (c) 2008 IBM Corporation and others. All rights reserved.
# 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:
# IBM Corporation - initial API and implementation
###############################################################################
# name/label for this linux connection
name = test_linux
# profile name this connection should be created for
profile_name = junit_test_profile
# Linux System ID
system_type_id = org.eclipse.rse.systemtype.linux
# Address of windows connection
address = unknown
# userid to connect to linux connection
#userid =
# password to connect to linux connection
#password =
# daemon port used for connecting to this linux connection
#daemon_port =

View file

@ -0,0 +1,22 @@
###############################################################################
# Copyright (c) 2008 IBM Corporation and others. All rights reserved.
# 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:
# IBM Corporation - initial API and implementation
###############################################################################
# name/label for this local connection
name = test_local
# profile name this connection should be created for
profile_name = junit_test_profile
# Local System ID
system_type_id = org.eclipse.rse.systemtype.local
# Address of local system
address = localhost

View file

@ -0,0 +1,28 @@
###############################################################################
# Copyright (c) 2008 IBM Corporation and others. All rights reserved.
# 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:
# IBM Corporation - initial API and implementation
###############################################################################
# name/label for this windows connection
name = test_ssh_only
# profile name this connection should be created for
profile_name = junit_test_profile
# SSH system ID
system_type_id = org.eclipse.rse.systemtype.ssh
# Address of ssh connection
address = unknown
# userid to connect to ssh connection
#userid =
# password to connect to ssh connection
#password =

View file

@ -0,0 +1,31 @@
###############################################################################
# Copyright (c) 2008 IBM Corporation and others. All rights reserved.
# 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:
# IBM Corporation - initial API and implementation
###############################################################################
# name/label for this windows connection
name = test_windows
# profile name this connection should be created for
profile_name = junit_test_profile
# Windows system ID
system_type_id = org.eclipse.rse.systemtype.windows
# Address of windows connection
address = unknown
# userid to connect to windows connection
#userid =
# password to connect to windows connection
#password =
# daemon port used for connecting to this windows connection
#daemon_port =