1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-21 07:05:58 +02:00

[198956][tests] Fix initialization of RSE Unit tests by waiting for InitRSEJob

This commit is contained in:
Martin Oberhuber 2007-08-06 17:02:44 +00:00
parent 47f4d7d7a8
commit 42cc075be4
7 changed files with 1372 additions and 1728 deletions

View file

@ -43,6 +43,8 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.persistence.IRSEPersistenceManager;
import org.eclipse.rse.tests.RSETestsPlugin; import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil.IInterruptCondition; import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil.IInterruptCondition;
import org.eclipse.rse.ui.SystemBasePlugin; import org.eclipse.rse.ui.SystemBasePlugin;
@ -346,16 +348,66 @@ public class RSECoreTestCase extends TestCase {
} }
} }
/**
* Wait until the SystemProfileManager has finished loading all "autoload" profiles,
* and the RSEUIPlugin InitRSEJob has finished filling it with the default connections.
* @throws InterruptedException
*/
protected void waitForRSEWorkspaceInit() throws InterruptedException {
//RSEUIPlugin is loaded automatically because RSETestsPlugins extends SystemBasePlugin,
//which is defined in org.eclipse.rse.ui, so we KNOW org.eclipse.rse.ui is started.
//TODO: At one point we want the tests to run headless, so then RSETestsPlugins should
//not extend SystemBasePlugin any more.
Job[] jobs = Job.getJobManager().find(null);
for(int i=0; i<jobs.length; i++) {
if ("Initialize RSE".equals(jobs[i].getName())) { //$NON-NLS-1$
System.out.println("Waiting for InitRSEJob"); //$NON-NLS-1$
jobs[i].join();
break;
}
}
//The code below would never be necessary during normal initialization,
//Since the InitRSEJob takes care of loading the profiles already.
//We still wait here, in order to ensure that unit tests are really
//separate from each other.
final IRSEPersistenceManager pm = RSECorePlugin.getThePersistenceManager();
while (!pm.isRestoreComplete() || pm.isBusy()) {
System.err.println("Waiting for Persistence Manager"); //$NON-NLS-1$
Thread.sleep(100);
}
}
/* (non-Javadoc) /* (non-Javadoc)
* @see junit.framework.TestCase#setUp() * @see junit.framework.TestCase#setUp()
*/ */
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
waitForRSEWorkspaceInit();
switchMaximizeSystemsView();
}
/* (non-Javadoc)
* @see junit.framework.TestCase#tearDown()
*/
protected void tearDown() throws Exception {
restoreMaximizeSystemsView();
super.tearDown();
}
// ***** View and perspective management and support methods *****
/**
* Bring the RSE SystemsView to front, and toggle its "maximized" state based on what
* the {@link IRSECoreTestCaseProperties#PROP_MAXIMIZE_REMOTE_SYSTEMS_VIEW} property
* requires for the given test case.
* In case a Workbench Intro View is hiding every else because this is the first
* product launch, it is hidden.
*/
protected void switchMaximizeSystemsView() {
final String perspectiveId = getProperty(IRSECoreTestCaseProperties.PROP_SWITCH_TO_PERSPECTIVE); final String perspectiveId = getProperty(IRSECoreTestCaseProperties.PROP_SWITCH_TO_PERSPECTIVE);
assertNotNull("Invalid null-value for test case perspective id!", perspectiveId); //$NON-NLS-1$ assertNotNull("Invalid null-value for test case perspective id!", perspectiveId); //$NON-NLS-1$
// all view managment must happen in the UI thread! // all view management must happen in the UI thread!
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() { public void run() {
// in case the test case is launched within a new workspace, the eclipse intro // in case the test case is launched within a new workspace, the eclipse intro
@ -382,19 +434,23 @@ public class RSECoreTestCase extends TestCase {
}); });
// Give the UI a chance to repaint if the view zoom state changed // Give the UI a chance to repaint if the view zoom state changed
if (isProperty(PROP_RSE_SYSTEMS_VIEW_ZOOM_STATE_CHANGED, true)) RSEWaitAndDispatchUtil.waitAndDispatch(1000); if (isProperty(PROP_RSE_SYSTEMS_VIEW_ZOOM_STATE_CHANGED, true)) {
System.err.println("Waiting for UI to repaint"); //$NON-NLS-1$
RSEWaitAndDispatchUtil.waitAndDispatch(1000);
}
} }
/* (non-Javadoc) /**
* @see junit.framework.TestCase#tearDown() * Restore the RSE SystemsView to its previous state, in case the view state
* has been changed by {@link #switchMaximizeSystemsView()}.
*/ */
protected void tearDown() throws Exception { protected void restoreMaximizeSystemsView() {
// restore the original view zoom state // restore the original view zoom state
if (isProperty(PROP_RSE_SYSTEMS_VIEW_ZOOM_STATE_CHANGED, true)) { if (isProperty(PROP_RSE_SYSTEMS_VIEW_ZOOM_STATE_CHANGED, true)) {
final String perspectiveId = getProperty(IRSECoreTestCaseProperties.PROP_SWITCH_TO_PERSPECTIVE); final String perspectiveId = getProperty(IRSECoreTestCaseProperties.PROP_SWITCH_TO_PERSPECTIVE);
assertNotNull("Invalid null-value for test case perspective id!", perspectiveId); //$NON-NLS-1$ assertNotNull("Invalid null-value for test case perspective id!", perspectiveId); //$NON-NLS-1$
// all view managment must happen in the UI thread! // all view management must happen in the UI thread!
PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
public void run() { public void run() {
IViewReference reference = findView(IRSEViews.RSE_REMOTE_SYSTEMS_VIEW_ID, perspectiveId); IViewReference reference = findView(IRSEViews.RSE_REMOTE_SYSTEMS_VIEW_ID, perspectiveId);
@ -410,12 +466,8 @@ public class RSECoreTestCase extends TestCase {
} }
}); });
} }
super.tearDown();
} }
// ***** View and perspective management and support methods *****
/** /**
* Finds the view reference for the view identified by the specified id. * Finds the view reference for the view identified by the specified id.
* *

View file

@ -28,6 +28,9 @@ import org.eclipse.rse.ui.RSEUIPlugin;
public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest { public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest {
private boolean fPreference_ALERT_SSL;
private boolean fPreference_ALERT_NONSSL;
public static junit.framework.Test suite() { public static junit.framework.Test suite() {
TestSuite suite = new TestSuite("FileServiceArchiveTestDStoreWindows"); TestSuite suite = new TestSuite("FileServiceArchiveTestDStoreWindows");
suite.addTest(TestSuite.createTest(FileServiceArchiveTestDStoreWindows.class, "testCopyBatchToArchiveFile")); //$NON-NLS-1$ suite.addTest(TestSuite.createTest(FileServiceArchiveTestDStoreWindows.class, "testCopyBatchToArchiveFile")); //$NON-NLS-1$
@ -55,34 +58,24 @@ public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest
return suite; return suite;
} }
public void setUp() { public void setUp() throws Exception {
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;
SYSTEM_ADDRESS = "LOCALHOST"; SYSTEM_ADDRESS = "LOCALHOST";
SYSTEM_NAME = "LOCALHOST_ds"; SYSTEM_NAME = "LOCALHOST_ds";
//We need to delay if it is first case run after a workspace startup //Ensure that the SSL acknowledge dialog does not show up.
if (!classBeenRunBefore) //We need to setDefault first in order to set the value of a preference.
{ IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore(); store.setDefault(ISystemPreferencesConstants.ALERT_SSL, ISystemPreferencesConstants.DEFAULT_ALERT_SSL);
store.setDefault(ISystemPreferencesConstants.ALERT_NONSSL, ISystemPreferencesConstants.DEFAULT_ALERT_NON_SSL);
fPreference_ALERT_SSL = store.getBoolean(ISystemPreferencesConstants.ALERT_SSL);
fPreference_ALERT_NONSSL = store.getBoolean(ISystemPreferencesConstants.ALERT_NONSSL);
store.setValue(ISystemPreferencesConstants.ALERT_SSL, false);
store.setValue(ISystemPreferencesConstants.ALERT_NONSSL, false);
//We need to setDefault first in order to set the value of a preference.
store.setDefault(ISystemPreferencesConstants.ALERT_SSL, ISystemPreferencesConstants.DEFAULT_ALERT_SSL);
store.setDefault(ISystemPreferencesConstants.ALERT_NONSSL, ISystemPreferencesConstants.DEFAULT_ALERT_NON_SSL);
store.setValue(ISystemPreferencesConstants.ALERT_SSL, false);
store.setValue(ISystemPreferencesConstants.ALERT_NONSSL, false);
try
{
System.out.println("need to sleep");
Thread.sleep(500);
}
catch (Exception e)
{
e.printStackTrace();
}
classBeenRunBefore = true;
}
IHost dstoreHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, "", ""); IHost dstoreHost = getRemoteSystemConnection(SYSTEM_TYPE_ID, SYSTEM_ADDRESS, SYSTEM_NAME, "", "");
assertTrue(dstoreHost != null); assertTrue(dstoreHost != null);
ISystemRegistry sr = SystemStartHere.getSystemRegistry(); ISystemRegistry sr = SystemStartHere.getSystemRegistry();
@ -153,12 +146,11 @@ public class FileServiceArchiveTestDStoreWindows extends FileServiceArchiveTest
} }
} }
public void tearDown() { public void tearDown() throws Exception {
try { IPreferenceStore store = RSEUIPlugin.getDefault().getPreferenceStore();
fss.delete(tempDir, mon); store.setValue(ISystemPreferencesConstants.ALERT_SSL, fPreference_ALERT_SSL);
} catch(SystemMessageException msg) { store.setValue(ISystemPreferencesConstants.ALERT_NONSSL, fPreference_ALERT_NONSSL);
assertFalse("Exception: "+msg.getLocalizedMessage(), true); //$NON-NLS-1$ super.tearDown();
}
} }
} }

View file

@ -25,13 +25,22 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager; import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
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;
import org.eclipse.rse.subsystems.files.core.subsystems.IVirtualRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IVirtualRemoteFile;
import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase; import org.eclipse.rse.tests.core.connection.RSEBaseConnectionTestCase;
/**
* Base class for file subsystem / file service unit tests.
* Contains helper methods for test environment setup.
*/
public class FileServiceBaseTest extends RSEBaseConnectionTestCase { public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
protected IFileServiceSubSystem fss; protected IFileServiceSubSystem fss;
@ -40,11 +49,43 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
protected IRemoteFile tempDir; protected IRemoteFile tempDir;
protected String tempDirPath; protected String tempDirPath;
protected IProgressMonitor mon = new NullProgressMonitor(); protected IProgressMonitor mon = new NullProgressMonitor();
protected static boolean classBeenRunBefore = false;
public static int TYPE_FILE = 0; public static int TYPE_FILE = 0;
public static int TYPE_FOLDER = 1; public static int TYPE_FOLDER = 1;
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();
}
}
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 {
try {
fss.delete(tempDir, mon);
} catch(SystemMessageException msg) {
//ensure that super.tearDown() can run
System.err.println("Exception on tearDown: "+msg.getLocalizedMessage()); //$NON-NLS-1$
}
super.tearDown();
}
public boolean isWindows() { public boolean isWindows() {
return fss.getHost().getSystemType().isWindows(); return fss.getHost().getSystemType().isWindows();
@ -61,133 +102,100 @@ public class FileServiceBaseTest extends RSEBaseConnectionTestCase {
} }
public IRemoteFile copySourceFileOrFolder(String sourceFullName, String sourceName, String targetFolderFullName) public IRemoteFile copySourceFileOrFolder(String sourceFullName, String sourceName, String targetFolderFullName) throws Exception
{ {
boolean ok = false; boolean ok = false;
IRemoteFile result = null; IRemoteFile result = null;
try IRemoteFile originalTargetArchiveFile = fss.getRemoteFileObject(sourceFullName, mon);
IRemoteFile targetFolder = fss.getRemoteFileObject(targetFolderFullName, mon);
ok = fss.copy(originalTargetArchiveFile, targetFolder, sourceName, mon);
if (ok)
{ {
IRemoteFile originalTargetArchiveFile = fss.getRemoteFileObject(sourceFullName, mon); //copy is successful
IRemoteFile targetFolder = fss.getRemoteFileObject(targetFolderFullName, mon); result = fss.getRemoteFileObject(getNewAbsoluteName(targetFolder, sourceName), mon);
ok = fss.copy(originalTargetArchiveFile, targetFolder, sourceName, mon);
if (ok)
{
//copy is successful
result = fss.getRemoteFileObject(getNewAbsoluteName(targetFolder, sourceName), mon);
}
//Need to call resolveFilterString of the parent to make sure the newly copied child
//is added to the DStore map. Otherwise, next time when query it, it will just created a
//default filter string. And the dstore server cannot handler it correctly.
fss.resolveFilterString(targetFolder, null, mon);
}
catch(Exception e)
{
return null;
} }
//Need to call resolveFilterString of the parent to make sure the newly copied child
//is added to the DStore map. Otherwise, next time when query it, it will just created a
//default filter string. And the dstore server cannot handler it correctly.
fss.resolveFilterString(targetFolder, null, mon);
return result; return result;
} }
public IRemoteFile createFileOrFolder(String targetFolderName, String fileOrFolderName, boolean isFolder) public IRemoteFile createFileOrFolder(String targetFolderName, String fileOrFolderName, boolean isFolder) throws Exception
{ {
IRemoteFile result = null; IRemoteFile result = null;
try System.out.println("createFileOrFolder: targetFolderName is " + targetFolderName);
IRemoteFile targetFolder = fss.getRemoteFileObject(targetFolderName, mon);
//fss.resolveFilterString(targetFolder, null, mon);
String fileOrFolderAbsName = getNewAbsoluteName(targetFolder, fileOrFolderName);
IRemoteFile newFileOrFolderPath = fss.getRemoteFileObject(fileOrFolderAbsName, mon);
if (isFolder)
{ {
System.out.println("targetFolderName is " + targetFolderName); result = fss.createFolder(newFileOrFolderPath, mon);
if (fss == null)
{
System.out.println("fss is null ");
}
IRemoteFile targetFolder = fss.getRemoteFileObject(targetFolderName, mon);
//fss.resolveFilterString(targetFolder, null, mon);
String fileOrFolderAbsName = getNewAbsoluteName(targetFolder, fileOrFolderName);
IRemoteFile newFileOrFolderPath = fss.getRemoteFileObject(fileOrFolderAbsName, mon);
if (isFolder)
{
result = fss.createFolder(newFileOrFolderPath, mon);
}
else
{
result = fss.createFile(newFileOrFolderPath, mon);
}
//Need to call resolveFilterString of the parent to make sure the newly created child
//is added to the DStore map. Otherwise, next time when query it, it will just created a
//default filter string. And the dstore server cannot handler it correctly.
fss.resolveFilterString(targetFolder, null, mon);
} }
catch (Exception e) else
{ {
e.printStackTrace(); result = fss.createFile(newFileOrFolderPath, mon);
return null;
} }
//Need to call resolveFilterString of the parent to make sure the newly created child
//is added to the DStore map. Otherwise, next time when query it, it will just created a
//default filter string. And the dstore server cannot handler it correctly.
fss.resolveFilterString(targetFolder, null, mon);
return result; return result;
} }
public Object getChildFromFolder(IRemoteFile folderToCheck, String childName) public Object getChildFromFolder(IRemoteFile folderToCheck, String childName) throws Exception
{ {
//then check the result of copy //then check the result of copy
Object[] children = null; Object[] children = null;
Object foundChild = null; Object foundChild = null;
try children = fss.resolveFilterString(folderToCheck, null, mon);
for (int i=0; i<children.length; i++)
{ {
children = fss.resolveFilterString(folderToCheck, null, mon); String thisName = ((IRemoteFile)children[i]).getName();
for (int i=0; i<children.length; i++) if (thisName.equals(childName))
{ {
String thisName = ((IRemoteFile)children[i]).getName(); foundChild = children[i];
if (thisName.equals(childName))
{
foundChild = children[i];
}
} }
} }
catch (Exception e)
{
foundChild = null;
}
return foundChild; return foundChild;
} }
public void checkFolderContents(IRemoteFile folderToCheck, String[] names, int[] types) public void checkFolderContents(IRemoteFile folderToCheck, String[] names, int[] types) throws Exception
{ {
try //the folder returned by the create API did not get the right attributes.
//We need to call getRemoteFileObject to get its attribute updated.
//Otherwise, will get error "directory not readable"
folderToCheck = fss.getRemoteFileObject(folderToCheck.getAbsolutePath(), mon);
System.out.println("verifying the contents for folder: " + folderToCheck.getAbsolutePath());
Object[] children = fss.resolveFilterString(folderToCheck, null, mon);
//Make sure the children array includes the copied folder.
HashMap childrenMap = new HashMap();
//Add children name into the map
for (int i=0; i<children.length; i++)
{ {
//the folder returned by the create API did not get the right attributes. String thisName = ((IRemoteFile)children[i]).getName();
//We need to call getRemoteFileObject to get its attribute updated. childrenMap.put(thisName, children[i]);
//Otherwise, will get error "directory not readable" }
folderToCheck = fss.getRemoteFileObject(folderToCheck.getAbsolutePath(), mon); //Check contents are in the array list
System.out.println("verifying the contents for folder: " + folderToCheck.getAbsolutePath()); for (int i=0; i<names.length; i++)
Object[] children = fss.resolveFilterString(folderToCheck, null, mon); {
//Make sure the children array includes the copied folder. IRemoteFile found = (IRemoteFile)(childrenMap.get(names[i]));
HashMap childrenMap = new HashMap(); assertTrue("Could not find " + names[i], found != null);
//Add children name into the map assertTrue(found.exists());
for (int i=0; i<children.length; i++) if (types != null && types.length != 0)
{ {
String thisName = ((IRemoteFile)children[i]).getName(); //If input array of types, we also need to check if the type is correct.
childrenMap.put(thisName, children[i]); if (types[i] == TYPE_FILE)
}
//Check contents are in the array list
for (int i=0; i<names.length; i++)
{
IRemoteFile found = (IRemoteFile)(childrenMap.get(names[i]));
assertTrue("Could not find " + names[i], found != null);
assertTrue(found.exists());
if (types != null && types.length != 0)
{ {
//If input array of types, we also need to check if the type is correct. assertTrue(found.isFile());
if (types[i] == TYPE_FILE) }
{ else if (types[i] == TYPE_FOLDER)
assertTrue(found.isFile()); {
} assertTrue(found.isDirectory());
else if (types[i] == TYPE_FOLDER)
{
assertTrue(found.isDirectory());
}
} }
} }
} }
catch (Exception e)
{
fail("Problem encountered: " + e.getStackTrace().toString());
}
} }
protected static String getNewAbsoluteName(IRemoteFile parentFolder, String newName) protected static String getNewAbsoluteName(IRemoteFile parentFolder, String newName)

View file

@ -18,9 +18,9 @@ import java.io.IOException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.IHost; 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.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.files.IFileService; import org.eclipse.rse.services.files.IFileService;
@ -37,9 +37,10 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
private String tempDirPath; private String tempDirPath;
private IProgressMonitor mon = new NullProgressMonitor(); private IProgressMonitor mon = new NullProgressMonitor();
public void setUp() { public void setUp() throws Exception {
super.setUp();
IHost localHost = getLocalSystemConnection(); IHost localHost = getLocalSystemConnection();
ISystemRegistry sr = SystemStartHere.getSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISubSystem[] ss = sr.getServiceSubSystems(localHost, IFileService.class); ISubSystem[] ss = sr.getServiceSubSystems(localHost, IFileService.class);
for (int i=0; i<ss.length; i++) { for (int i=0; i<ss.length; i++) {
if (ss[i] instanceof IFileServiceSubSystem) { if (ss[i] instanceof IFileServiceSubSystem) {
@ -57,12 +58,14 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
} }
} }
public void tearDown() { public void tearDown() throws Exception {
try { try {
fs.delete(tempDir.getParent(), tempDir.getName(), mon); fs.delete(tempDir.getParent(), tempDir.getName(), mon);
} catch(SystemMessageException msg) { } catch(SystemMessageException msg) {
assertFalse("Exception: "+msg.getLocalizedMessage(), true); //$NON-NLS-1$ //ensure that super.tearDown() can run
System.err.println("Exception on tearDown: "+msg.getLocalizedMessage()); //$NON-NLS-1$
} }
super.tearDown();
} }
public boolean isWindows() { public boolean isWindows() {

View file

@ -1,36 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig"> <launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
<stringAttribute key="bootstrap" value=""/>
<booleanAttribute key="useProduct" value="true"/>
<booleanAttribute key="tracing" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="4"/>
</listAttribute>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="automaticValidate" value="false"/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<booleanAttribute key="automaticAdd" value="true"/>
<stringAttribute key="checked" value="[NONE]"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-test-workspace"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="clearws" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.rse.tests.RSECombinedTestSuite"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-debug -clean"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<booleanAttribute key="useDefaultConfigArea" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.rse.tests"/>
<booleanAttribute key="askclear" value="false"/> <booleanAttribute key="askclear" value="false"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS"> <booleanAttribute key="automaticAdd" value="true"/>
<listEntry value="/org.eclipse.rse.tests"/> <booleanAttribute key="automaticValidate" value="false"/>
</listAttribute> <stringAttribute key="bootstrap" value=""/>
<stringAttribute key="checked" value="[NONE]"/>
<booleanAttribute key="clearConfig" value="true"/>
<booleanAttribute key="clearws" value="true"/>
<booleanAttribute key="clearwslog" value="false"/>
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
<booleanAttribute key="default" value="true"/>
<booleanAttribute key="includeOptional" value="true"/> <booleanAttribute key="includeOptional" value="true"/>
<stringAttribute key="location" value="${workspace_loc}/../junit-test-workspace"/>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
<listEntry value="/org.eclipse.rse.tests/src/org/eclipse/rse/tests/RSECombinedTestSuite.java"/>
</listAttribute>
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
<listEntry value="1"/>
</listAttribute>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/> <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.rse.tests.RSECombinedTestSuite"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -debug -clean"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.rse.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea -esa -Dcom.sun.management.jmxremote"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useDefaultConfig" value="true"/>
<booleanAttribute key="useDefaultConfigArea" value="false"/>
<booleanAttribute key="useProduct" value="true"/>
</launchConfiguration> </launchConfiguration>