mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-27 10:55:33 +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.SystemStartHere;
|
||||||
import org.eclipse.rse.core.model.SystemWorkspaceResourceSet;
|
import org.eclipse.rse.core.model.SystemWorkspaceResourceSet;
|
||||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
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.ISubSystem;
|
||||||
import org.eclipse.rse.core.subsystems.ISystemDragDropAdapter;
|
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.files.ui.resources.UniversalFileTransferUtility;
|
||||||
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
||||||
import org.eclipse.rse.services.files.IFileService;
|
import org.eclipse.rse.services.files.IFileService;
|
||||||
|
@ -95,8 +98,7 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setUp() throws Exception {
|
protected void setupFileSubSystem() {
|
||||||
super.setUp();
|
|
||||||
|
|
||||||
//We need to delay if it is first case run after a workspace startup
|
//We need to delay if it is first case run after a workspace startup
|
||||||
SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_LINUX_ID;
|
SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_LINUX_ID;
|
||||||
|
@ -105,6 +107,13 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
|
||||||
USER_ID = "xuanchen";
|
USER_ID = "xuanchen";
|
||||||
PASSWORD = "xxxxxx";
|
PASSWORD = "xxxxxx";
|
||||||
|
|
||||||
|
/*
|
||||||
|
SYSTEM_ADDRESS = "dmcknigh3";
|
||||||
|
SYSTEM_NAME = "dmcknigh3_ds";
|
||||||
|
USER_ID = "tester";
|
||||||
|
PASSWORD = "xxxxxx";
|
||||||
|
*/
|
||||||
|
|
||||||
//Ensure that the SSL acknowledge dialog does not show up.
|
//Ensure that the SSL acknowledge dialog does not show up.
|
||||||
//We need to setDefault first in order to set the value of a preference.
|
//We need to setDefault first in order to set the value of a preference.
|
||||||
IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
|
IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
|
||||||
|
@ -158,27 +167,13 @@ public class FileServiceArchiveTestDStore extends FileServiceArchiveTest {
|
||||||
{
|
{
|
||||||
IRemoteServerLauncher sl = (IRemoteServerLauncher)properties;
|
IRemoteServerLauncher sl = (IRemoteServerLauncher)properties;
|
||||||
sl.setServerLaunchType(ServerLaunchType.get(ServerLaunchType.RUNNING));
|
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);
|
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) {
|
} catch(Exception e) {
|
||||||
assertTrue("Exception creating temp dir " + e.getStackTrace().toString(), false); //$NON-NLS-1$
|
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.ISystemRegistry;
|
||||||
import org.eclipse.rse.core.model.SystemStartHere;
|
import org.eclipse.rse.core.model.SystemStartHere;
|
||||||
import org.eclipse.rse.core.subsystems.IConnectorService;
|
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.ISubSystem;
|
||||||
|
import org.eclipse.rse.core.subsystems.ServerLaunchType;
|
||||||
import org.eclipse.rse.services.files.IFileService;
|
import org.eclipse.rse.services.files.IFileService;
|
||||||
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
|
import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
|
||||||
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
|
||||||
|
@ -62,8 +65,7 @@ public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest
|
||||||
return suite;
|
return suite;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setUp() throws Exception {
|
protected void setupFileSubSystem() {
|
||||||
super.setUp();
|
|
||||||
|
|
||||||
//We need to delay if it is first case run after a workspace startup
|
//We need to delay if it is first case run after a workspace startup
|
||||||
SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_WINDOWS_ID;
|
SYSTEM_TYPE_ID = IRSESystemType.SYSTEMTYPE_WINDOWS_ID;
|
||||||
|
@ -130,21 +132,6 @@ public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest
|
||||||
|
|
||||||
connectionService.connect(mon);
|
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) {
|
} catch(Exception e) {
|
||||||
assertTrue("Exception creating temp dir " + e.getStackTrace().toString(), false); //$NON-NLS-1$
|
assertTrue("Exception creating temp dir " + e.getStackTrace().toString(), false); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,20 +57,10 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
|
||||||
|
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
setupFileSubSystem();
|
||||||
IHost localHost = getLocalSystemConnection();
|
//Create a temparory directory in My Home
|
||||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
try
|
||||||
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);
|
|
||||||
|
|
||||||
//Create a temporary directory in My Home
|
|
||||||
IRemoteFile homeDirectory = fss.getRemoteFileObject(".", mon);
|
IRemoteFile homeDirectory = fss.getRemoteFileObject(".", mon);
|
||||||
String baseFolderName = "rsetest";
|
String baseFolderName = "rsetest";
|
||||||
String homeFolderName = homeDirectory.getAbsolutePath();
|
String homeFolderName = homeDirectory.getAbsolutePath();
|
||||||
|
@ -78,6 +68,11 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
|
||||||
tempDir = createFileOrFolder(homeFolderName, testFolderName, true);
|
tempDir = createFileOrFolder(homeFolderName, testFolderName, true);
|
||||||
tempDirPath = tempDir.getAbsolutePath();
|
tempDirPath = tempDir.getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
fail("Problem encountered: " + e.getStackTrace().toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void tearDown() throws Exception {
|
public void tearDown() throws Exception {
|
||||||
try {
|
try {
|
||||||
|
@ -390,4 +385,22 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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