Hi,
I'm trying to modify Jackrabbit to work _only_ in memory and persist _nothing_
in the file system. I want this for testing purposes, where I don't like any
files being created besides the fact that memory should be the fastest. My test
data sets aren't that large anyway so memory usage is not a concern.
My first approach was to use an InMemPersistenceManager, a RAMDirectory for
lucene and my own MemoryFileSystem based on JackRabbits FileSystem. But I found
that InMemPersistenceManager uses the file system as well. And apparently it's
quite difficult to get PersistentIndex using RAMDirectories. To make it even
harder the configured FileSystem isn't used for all data Jackrabbit persists.
And if this FileSystem is used or not depends on "configRootPath"-attribute
which must be set in the repository.xml but is not allowed by the DTD.
I still don't get what this FileSystem is used for. Maybe someone with deeper
knowlegde of the system could explain it to me? Or is it just there for
historical reasons?
However, maybe someone has a better strategy to get a lightweight repository
which could be quickly initialized and is usable in unit tests. I don't like the
idea to mock the JCR API because this way our tests become to unnatural and complex.
Looking forward some ideas how to best test the interface from your own code to
Jackrabbit ;)
Cheers,
Christoph
- Jackrabbits own FileSystem and unit tests Christoph Kiehl
-