This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When running in unit tests, without core.jar in classpath the default repository returned from Repository.getDefault() creates default filesystem as XMLFileSystem. As a result tests need to do complicated setups to be able to write to default filesystem and/or sometimes use core.jar just to get the write permition. The proposal changes the Repository.getDefaultFileSystem() to be in memory only fully featured filesystem. As this impl used to be in core, it adds new method FileUtil.createMemoryFileSystem so core can get its own instance when it needs it.
Created attachment 16522 [details] The changes
Reviewers, please comment.
Looks OK to me.
The changes look fine to me. Do all the tests pass for you? I did not try them now (in trunk) but there were couple of failures for me in the past (in 3.6).
There was one line mistake during rename. I've fixed it and now all the tests pass. So the MemoryFS in diff is not completely same as the memory fs in current core trunk.
Ok, will be integrated.
grep Index: X.diff | grep -v ExplorerPanelTest | cut -c 8- core/src/org/netbeans/core/projects/MemoryFileSystem.java core/src/org/netbeans/core/projects/SystemFileSystem.java openide/openide-spec-vers.properties openide/api/doc/changes/apichanges.xml openide/src/org/openide/filesystems/ExternalUtil.java openide/src/org/openide/filesystems/FileUtil.java openide/src/org/openide/filesystems/MemoryFileSystem.java ~/work$ grep Index: X.diff | grep -v ExplorerPanelTest | cut -c 8- | xargs cvs ci -m "#46701: Factory for creation of writeable memory file system" Removing core/src/org/netbeans/core/projects/MemoryFileSystem.java; /cvs/core/src/org/netbeans/core/projects/MemoryFileSystem.java,v <-- MemoryFileSystem.java new revision: delete; previous revision: 1.8 done Checking in core/src/org/netbeans/core/projects/SystemFileSystem.java; /cvs/core/src/org/netbeans/core/projects/SystemFileSystem.java,v <-- SystemFileSystem.java new revision: 1.42; previous revision: 1.41 done Processing log script arguments... More commits to come... Checking in openide/openide-spec-vers.properties; /cvs/openide/openide-spec-vers.properties,v <-- openide-spec-vers.properties new revision: 1.153; previous revision: 1.152 done Processing log script arguments... More commits to come... Checking in openide/api/doc/changes/apichanges.xml; /cvs/openide/api/doc/changes/apichanges.xml,v <-- apichanges.xml new revision: 1.213; previous revision: 1.212 done Processing log script arguments... More commits to come... Checking in openide/src/org/openide/filesystems/ExternalUtil.java; /cvs/openide/src/org/openide/filesystems/ExternalUtil.java,v <-- ExternalUtil.java new revision: 1.8; previous revision: 1.7 done Checking in openide/src/org/openide/filesystems/FileUtil.java; /cvs/openide/src/org/openide/filesystems/FileUtil.java,v <-- FileUtil.java new revision: 1.107; previous revision: 1.106 done RCS file: /cvs/openide/src/org/openide/filesystems/MemoryFileSystem.java,v done Checking in openide/src/org/openide/filesystems/MemoryFileSystem.java; /cvs/openide/src/org/openide/filesystems/MemoryFileSystem.java,v <-- MemoryFileSystem.java initial revision: 1.1
Verified.