mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-03 15:15:25 +02:00
[200404] fix: [junit-tests] rsetest###### directories aren't all removed when running Archive tests
This commit is contained in:
parent
1add2dba42
commit
62aeab40fd
3 changed files with 49 additions and 54 deletions
|
@ -24,8 +24,11 @@ import org.eclipse.rse.core.model.SystemRemoteResourceSet;
|
|||
import org.eclipse.rse.core.model.SystemStartHere;
|
||||
import org.eclipse.rse.core.model.SystemWorkspaceResourceSet;
|
||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
||||
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.ISystemDragDropAdapter;
|
||||
import org.eclipse.rse.core.subsystems.ServerLaunchType;
|
||||
import org.eclipse.rse.files.ui.resources.UniversalFileTransferUtility;
|
||||
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
||||
import org.eclipse.rse.services.files.IFileService;
|
||||
|
@ -95,8 +98,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
|
|||
|
||||
|
||||
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
protected void setupFileSubSystem() {
|
||||
|
||||
//We need to delay if it is first case run after a workspace startup
|
||||
SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_LINUX_ID;
|
||||
|
@ -105,6 +107,13 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
|
|||
USER_ID = "xuanchen";
|
||||
PASSWORD = "xxxxxx";
|
||||
|
||||
/*
|
||||
SYSTEM_ADDRESS = "dmcknigh3";
|
||||
SYSTEM_NAME = "dmcknigh3_ds";
|
||||
USER_ID = "tester";
|
||||
PASSWORD = "xxxxxx";
|
||||
*/
|
||||
|
||||
//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();
|
||||
|
@ -158,27 +167,13 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
|
|||
{
|
||||
IRemoteServerLauncher sl = (IRemoteServerLauncher)properties;
|
||||
sl.setServerLaunchType(ServerLaunchType.get(ServerLaunchType.RUNNING));
|
||||
fss.getSubSystemConfiguration().updateSubSystem(fss, false, "xuanchen", true, 4033);
|
||||
fss.getSubSystemConfiguration().updateSubSystem(fss, false, "tester", true, 4033);
|
||||
}
|
||||
*/
|
||||
//end here
|
||||
|
||||
connectionService.connect(mon);
|
||||
|
||||
//Create a temparory directory in My Home
|
||||
try
|
||||
{
|
||||
IRemoteFile homeDirectory = fss.getRemoteFileObject(".", mon);
|
||||
String baseFolderName = "rsetest";
|
||||
String homeFolderName = homeDirectory.getAbsolutePath();
|
||||
String testFolderName = FileServiceHelper.getRandomLocation(fss, homeFolderName, baseFolderName, mon);
|
||||
tempDir = createFileOrFolder(homeFolderName, testFolderName, true);
|
||||
tempDirPath = tempDir.getAbsolutePath();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
fail("Problem encountered: " + e.getStackTrace().toString());
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
assertTrue("Exception creating temp dir " + e.getStackTrace().toString(), false); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -18,7 +18,10 @@ 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.IConnectorService;
|
||||
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.ServerLaunchType;
|
||||
import org.eclipse.rse.services.files.IFileService;
|
||||
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
|
||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||
|
@ -62,8 +65,7 @@ public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest
|
|||
return suite;
|
||||
}
|
||||
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
protected void setupFileSubSystem() {
|
||||
|
||||
//We need to delay if it is first case run after a workspace startup
|
||||
SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_WINDOWS_ID;
|
||||
|
@ -130,21 +132,6 @@ public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest
|
|||
|
||||
connectionService.connect(mon);
|
||||
|
||||
//Create a temparory directory in My Home
|
||||
try
|
||||
{
|
||||
IRemoteFile homeDirectory = fss.getRemoteFileObject(".", mon);
|
||||
String baseFolderName = "rsetest";
|
||||
String homeFolderName = homeDirectory.getAbsolutePath();
|
||||
String testFolderName = FileServiceHelper.getRandomLocation(fss, homeFolderName, baseFolderName, mon);
|
||||
tempDir = createFileOrFolder(homeFolderName, testFolderName, true);
|
||||
tempDirPath = tempDir.getAbsolutePath();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
fail("Problem encountered: " + e.getStackTrace().toString());
|
||||
}
|
||||
|
||||
} catch(Exception e) {
|
||||
assertTrue("Exception creating temp dir " + e.getStackTrace().toString(), false); //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -57,26 +57,21 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
|
|||
|
||||
public void setUp() throws Exception {
|
||||
super.setUp();
|
||||
|
||||
IHost localHost = getLocalSystemConnection();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
ISubSystem[] ss = sr.getServiceSubSystems(localHost, IFileService.class);
|
||||
for (int i=0; i<ss.length; i++) {
|
||||
if (ss[i] instanceof IFileServiceSubSystem) {
|
||||
fss = (IFileServiceSubSystem)ss[i];
|
||||
fs = fss.getFileService();
|
||||
}
|
||||
setupFileSubSystem();
|
||||
//Create a temparory directory in My Home
|
||||
try
|
||||
{
|
||||
IRemoteFile homeDirectory = fss.getRemoteFileObject(".", mon);
|
||||
String baseFolderName = "rsetest";
|
||||
String homeFolderName = homeDirectory.getAbsolutePath();
|
||||
String testFolderName = FileServiceHelper.getRandomLocation(fss, homeFolderName, baseFolderName, mon);
|
||||
tempDir = createFileOrFolder(homeFolderName, testFolderName, true);
|
||||
tempDirPath = tempDir.getAbsolutePath();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
fail("Problem encountered: " + e.getStackTrace().toString());
|
||||
}
|
||||
localFss = fss; //Used for creating test source data.
|
||||
assertNotNull(localFss);
|
||||
|
||||
//Create a temporary directory in My Home
|
||||
IRemoteFile homeDirectory = fss.getRemoteFileObject(".", mon);
|
||||
String baseFolderName = "rsetest";
|
||||
String homeFolderName = homeDirectory.getAbsolutePath();
|
||||
String testFolderName = FileServiceHelper.getRandomLocation(fss, homeFolderName, baseFolderName, mon);
|
||||
tempDir = createFileOrFolder(homeFolderName, testFolderName, true);
|
||||
tempDirPath = tempDir.getAbsolutePath();
|
||||
}
|
||||
|
||||
public void tearDown() throws Exception {
|
||||
|
@ -389,5 +384,23 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
|
|||
return "these are my contents";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup the file subsystem used for this testcase
|
||||
*/
|
||||
protected void setupFileSubSystem()
|
||||
{
|
||||
IHost localHost = getLocalSystemConnection();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
ISubSystem[] ss = sr.getServiceSubSystems(localHost, IFileService.class);
|
||||
for (int i=0; i<ss.length; i++) {
|
||||
if (ss[i] instanceof IFileServiceSubSystem) {
|
||||
fss = (IFileServiceSubSystem)ss[i];
|
||||
fs = fss.getFileService();
|
||||
}
|
||||
}
|
||||
localFss = fss; //Used for creating test source data.
|
||||
assertNotNull(localFss);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue