clojurewerkz / ogre

Clojure library for querying Apache TinkerPop graphs
http://ogre.clojurewerkz.org/
128 stars 28 forks source link

Run TinkerPop test suite for Ogre #65

Closed fitzoh closed 9 years ago

fitzoh commented 9 years ago

working towards getting tinkerpop test suite working #27

fitzoh commented 9 years ago

It's ugly, but there's now a single test running off clojure code

spmallette commented 9 years ago

interesting. you definitely got past the point where i felt blocked - so that's good. what would you say is the next step?

fitzoh commented 9 years ago

I'm not entirely sure. the most obvious route seems to be applying the same pattern to fill out the rest of the test suite, create a java class mirroring each test, and usee that to get the closure version of the traversal.

It would be nice if there were an easy way to accomplish that with a little less ceremony.

spmallette commented 9 years ago

I agree that if there was a nicer way to do this, it would be good to find it. it would stink to spend time implementing that pattern against the full gremlin test suite (which is a lot) only to have to change it all again later if that nicer way became apparent. at least you have a method for doing it - that was a really big step - thanks for that.

fitzoh commented 9 years ago

So I was playing with this a little bit more.

I figured out how to create a clojure class which extends a java test case, and I can execute the test, but annotations aren't working, which means the test graphs aren't being loaded.

Empty graphs are from extending DedupTest in Clojure, populated graphs are from extending DedupTest in Java.

------------- Standard Output ---------------
#<TinkerGraph tinkergraph[vertices:0 edges:0]>
Testing: [GraphStep(vertex), VertexStep(BOTH,vertex), DedupStep, PropertiesStep([name],value)]
         [TinkerGraphStep(vertex), VertexStep(BOTH,vertex), DedupStep, PropertiesStep([name],value)]
#<TinkerGraph tinkergraph[vertices:0 edges:0]>
Testing: [GraphStep(vertex), VertexStep(BOTH,vertex), DedupStep, PropertiesStep([name],value)]
         [TinkerGraphStep(vertex), VertexStep(BOTH,vertex), DedupStep, PropertiesStep([name],value)]
#<TinkerGraph tinkergraph[vertices:0 edges:0]>
Testing: [GraphStep(vertex), VertexStep(BOTH,vertex), DedupStep, PropertiesStep([name],value)]
         [TinkerGraphStep(vertex), VertexStep(BOTH,vertex), DedupStep, PropertiesStep([name],value)]
g = tinkergraph[vertices:6 edges:6]
Testing: [GraphStep(vertex), VertexStep(BOTH,vertex), HasStep([~label,eq,software]), DedupStep(value(lang)), PropertiesStep([name],value)]
         [TinkerGraphStep(vertex), VertexStep(BOTH,vertex), HasStep([~label,eq,software]), DedupStep(value(lang)), PropertiesStep([name],value)]
g = tinkergraph[vertices:6 edges:6]
Testing: [GraphStep(vertex), VertexStep(BOTH,vertex), DedupStep, PropertiesStep([name],value)]
         [TinkerGraphStep(vertex), VertexStep(BOTH,vertex), DedupStep, PropertiesStep([name],value)]
g = tinkergraph[vertices:6 edges:6]
Testing: [GraphStep(vertex), VertexStep(BOTH,vertex), PropertiesStep([name],property), OrderStep(lambda), DedupStep, PropertyValueStep]
         [TinkerGraphStep(vertex), VertexStep(BOTH,vertex), PropertiesStep([name],property), OrderStep(lambda), DedupStep, PropertyValueStep]
spmallette commented 9 years ago

hmmm - good try. thanks for sticking with this. figuring out a nice way to get this working will be important for ensuring ogre has solid integration over tinkerpop. even a sub-optimal solution beats re-implementing the hundreds of tests that the test-suite has.