| Summary: | [Tests] Leverage tests for other files systems basing on FileSystemTest | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | Tomasz Zarna <tomasz.zarna> | ||||||||||
| Component: | Resources | Assignee: | Tomasz Zarna <tomasz.zarna> | ||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | jamesblackburn+eclipse, Szymon.Brandys | ||||||||||
| Version: | 3.7 | Flags: | Szymon.Brandys:
review+
|
||||||||||
| Target Milestone: | 3.7 M5 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows XP | ||||||||||||
| Whiteboard: | |||||||||||||
| Attachments: |
|
||||||||||||
Created attachment 185686 [details]
Somce changes in the proposal
I think we can simplify the code a bit.
Fine with me, the only thing I would change is the comment for doFSSetUp()/doFSTearDown() methods and suggest to override the methods to test a different FS. A setup/cleanup for a custom FS shouldn't be made by modifying org.eclipse.core.tests.filesystem.FileSystemTest as one may understand the current comment. Please attach a patch with suggested changes and I will commit it. Created attachment 185689 [details]
Szymon's patch with the suggestion about subclassing
Created attachment 185690 [details]
mylyn/context/zip
The fix committed to HEAD. |
Created attachment 183845 [details] Patch for org.eclipse.core.tests.resources FileSystemTest is a base class for CreateDirectoryTest, DeleteTest, OpenOutputStreamTest and PutInfoTest which all can be use to test file systems other then "mem". I managed to reuse the tests by adding 3 simple methods to FileSystemTest : * getFileStoreUri, to provide URI for your fs * fileSystemSetUp, to setup your fs * fileSystemTearDown, to cleanup when done A better approach would be to create an abstract class with these methods + add a default implementation for the "mem" fs. But is that really necessary?