Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Testing and Workspace Deletion
Testing and Workspace Deletion [message #332297] Fri, 17 October 2008 14:18 Go to next message
Jared is currently offline JaredFriend
Messages: 3
Registered: July 2009
Junior Member
I have a collection of tests that create several projects and files within
the workspace that are repeatedly cleared before each JUnit test:

@Before
public void clearWS() {
IWorkspace ws = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = ws.getRoot();

try {
root.delete(true, true, null);
} catch (CoreException e) {
fail(UNABLE_EMPTY_WS_MSG);
}
}

The first several tests always run successfully while the last half (~8)
randomly pass or fail, with the failure occurring because the resource
cannot be deleted (CoreException). All of the tests write files into the
workspace in the same manner, so I don't understand why clearing the
workspace sometimes fails.

My only thought is that there is a lock on a file or folder resource, but
I am closing all of my file streams after writing.

Any thoughts on this would be appreciated,
J
Re: Testing and Workspace Deletion [message #332298 is a reply to message #332297] Fri, 17 October 2008 14:26 Go to previous message
Jared is currently offline JaredFriend
Messages: 3
Registered: July 2009
Junior Member
I forgot to mention that this always passes in Linux (ext2fs) - but when
run in Windows XP on NTFS sporadically fails.
Previous Topic:Command line update / local mirror: Only mirror latest versions
Next Topic:How to set and get a configuration file for a eclipse plugin
Goto Forum:
  


Current Time: Fri Apr 26 03:16:34 GMT 2024

Powered by FUDForum. Page generated in 0.02978 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top