Re: Unit testing with JanusGraph


Suny <sahithiy...@...>
 

Thanks.

I startup JG instance in my local and use this code to connect to it 

GryoMapper.Builder builder = GryoMapper.build().addRegistry(JanusGraphIoRegistry.getInstance());

cluster = Cluster.build().serializer(new GryoMessageSerializerV1d0(builder)).addContactPoint(serverUrl).create();

client = cluster.connect();


where serverUrl is localhost:8081. This instance has cassandra configured as backend.


Now if i want to run a unit test against in-memory db, Should i run another instance of JG on different port and connect to it from application ?


On Thursday, September 7, 2017 at 1:59:46 PM UTC-4, Vladyslav Kosulin wrote:
Suny, in the original post you wrote about "in-memory database for unit testing and cassandra for the real application data on same janusgraph instance".
I assumed you mean same JG instance for both testing and production which I would strongly object about.

But even speaking about separation of JG instances for in-memory unit testing and for (acceptance/regression) testing with real backend - yes, I would keep them separate. JG itself is very cheap to run, and such setup will allow you to have testing environment as closely matching production as possible while using another env for development including changes to JG config and upgrades.

On Thursday, September 7, 2017 at 11:24:54 AM UTC-4, Suny wrote:
Thanks for you response. So I should use 2 instances of JG - One with in-memory backed to perform unit testing and other with cassandra to run functional use cases ?

On Thursday, September 7, 2017 at 10:56:44 AM UTC-4, Vladyslav Kosulin wrote:
Oh, and I would always use separate JG instance for testing if it is possible.

Join janusgraph-users@lists.lfaidata.foundation to automatically receive all group messages.