testing a DAO API with titan graph db

71 views
Skip to first unread message

Arbi Sookazian

unread,
Mar 26, 2015, 8:51:39 PM3/26/15
to aureliu...@googlegroups.com

I have a Java DAO API which is fronted by a REST API.  I have created a TestSuite in SOAP UI to help with test automation but that currently has hard-coded parameter values so it's brittle.  I have used dbUnit in the past to load a RDBMS schema with a xml file and test DAOs.  Not sure if dbUnit is compatible with titan/cassandra.

So I'd like to at least export/import XML (or whatever other format like GraphSON) to ensure a consistent/deterministic dataset for my DAO testing.  I found this thread:  https://groups.google.com/forum/#!topic/aureliusgraphs/c3A-4OwMCho

But I get null for the outputGraph operation.  I have also tried g = TitanFactory.open(“/private/var/nextgate/b03192015-trunk-cassandra/ngs/etc/nextgate/er/nger.titan.properties”) with same results (0 kb output file).  Also, sounds like the OP for the above thread never got the import to work.

There was another thread discussing Faunus but I was not able to see a concrete example/code of how to export/import.  I did read this: https://github.com/thinkaurelius/faunus/wiki/Titan-Format

In the below code for the Format Cassandra output, what is the name of the file/location where it is stored?

gremlin> g = FaunusFactory.open('bin/titan-cassandra-output.properties') 
==>faunusgraph[graphsoninputformat]
gremlin> g.V.sideEffect('{it.roman = true}') 
13/01/04 15:44:42 INFO mapreduce.FaunusCompiler: Compiled to 1 MapReduce job(s)
13/01/04 15:44:42 INFO mapreduce.FaunusCompiler: Executing job 1 out of 1: MapSequence[com.thinkaurelius.faunus.mapreduce.transform.VerticesMap.Map, com.thinkaurelius.faunus.mapreduce.sideeffect.SideEffectMap.Map, com.thinkaurelius.faunus.formats.BlueprintsGraphOutputMapReduce.Map, com.thinkaurelius.faunus.formats.BlueprintsGraphOutputMapReduce.Reduce]

/************************************************************************************************************************************************************************/

14:36:38 WARN  org.apache.hadoop.util.NativeCodeLoader  - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable

gremlin> g = TitanFactory.open('/Users/arbisookazian/sw/titan-0.5.4-hadoop2/conf/titan-cassandra-es.properties')

14:37:22 WARN  com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration  - Local setting cache.db-cache-time=180000 (Type: GLOBAL_OFFLINE) is overridden by globally managed value (10000).  Use the ManagementSystem interface instead of the local configuration to control this setting.

14:37:22 WARN  com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration  - Local setting cache.db-cache-clean-wait=20 (Type: GLOBAL_OFFLINE) is overridden by globally managed value (50).  Use the ManagementSystem interface instead of the local configuration to control this setting.

==>titangraph[cassandrathrift:[127.0.0.1]]

gremlin> out = new FileOutputStream("/Users/arbisookazian/temp/java/titan-graph.graphml")

==>java.io.FileOutputStream@5729bc61

gremlin> GraphMLWriter.outputGraph(g, out)

==>null

Stephen Mallette

unread,
Mar 27, 2015, 6:52:54 AM3/27/15
to aureliu...@googlegroups.com
I got a little bit confused by your post.  Before looking deeper I thought that I would address this piece in the middle of your post: "But I get null for the outputGraph operation."  Does that refer to this:

gremlin> GraphMLWriter.outputGraph(g, out)

==>null


I would expect "null" here  as outputGraph returns void and the Gremlin console treats that output as a "null".  I would expect to find a file with GraphML in it at the location defined in your OutputStream...it worked ok for me:

gremlin> g = GraphOfTheGodsFactory.create('/tmp/gog')
==>titangraph[berkeleyje:/tmp/gog]
gremlin> out = new FileOutputStream("test.xml")
==>java.io.FileOutputStream@37e55819
gremlin> GraphMLWriter.outputGraph(g, out)
==>null


--
You received this message because you are subscribed to the Google Groups "Aurelius" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aureliusgraph...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/aureliusgraphs/78ef450d-1318-4a11-ae15-59819879fb6a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages