[Neo] Can you use EmbeddedGraphDatabase without a filesystem?

Hans Brattberg hans.brattberg at crisp.se
Fri Feb 26 22:52:15 CET 2010


Interesting point, but i prefer measuring the performance on a system
level rather than down in my unit tests, and to write very quick unit
tests when I can.

In this case it was more interested in getting rid of the need to do
anyting in my tearDown and/or setUp methods. I usually prefer to get
rid of external dependencies in my unit tests.

/Hans

On Fri, Feb 26, 2010 at 10:32 PM, Raul Raja Martinez <raulraja at gmail.com> wrote:
> We setup an fs based graph on the jvm java.io.tmp folder and destroy
> on every setup() teardown() if necessary.
> This is how all of our unit tests run and it works fine.
> An in memory store may give you a false view on how things work if one
> of the things you are testing is performance, specially in the case of
> your production store being fs based
>
> 2010/2/26 Mattias Persson <mattias at neotechnology.com>:
>> 2010/2/26 Hans Brattberg <hans.brattberg at crisp.se>:
>>> Hi!
>>>
>>> For test automation it could be useful to create an instance of
>>> EmbeddedGraphDatabase that don't use the file system, but only keep
>>> the data in memory, in the same way hsqldb can be configured.
>>>
>>> Is there another version of EmbeddedGraphDatabase for that purpose, or
>>> has any one a solution fort this?
>>>
>>> /Hans
>>
>> At the moment there's only the filesystem backend, but we're planning
>> to add such an in-memory backend to have, as you say, for tests and
>> such.
>>
>> One solution right now could be to create a file system in RAM,
>> http://en.wikipedia.org/wiki/RAM_disk, but that would probably require
>> you to delete/recreate the file system or use a new database folder
>> name for each test... much like deleting your my/neo4j-db/ database
>> folder before each test. So the problem wouldn't really go away.
>>
>> In most cases you can just have a MyFileUtils.deleteDirectory(
>> "my/neo4j-db" ) before instantiating your EmbeddedGraphDatabase
>> instance, but that's probably what you're trying to get away from :) ?
>>
>> --
>> Mattias Persson, [mattias at neotechnology.com]
>> Neo Technology, www.neotechnology.com
>> _______________________________________________
>> Neo mailing list
>> User at lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
>
>
> --
> Raul Raja
> _______________________________________________
> Neo mailing list
> User at lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Hans Brattberg
hans.brattberg at crisp.se
+46 (0)70 575 31 32


More information about the User mailing list