Permalink
Browse files

Properly drop database between requests. #268

This is from Luca and allows the tests to run.  The tests still fail, because OrientDB doesn't support a "." in key names and GraphSail uses such a key.  If the key is changed then everything should work.  Awaiting an update from Josh on whether it is ok to do that or not.
  • Loading branch information...
1 parent 0b9bb02 commit b16945fbc853918626e38e6217319c54bf7b66b3 @spmallette spmallette committed Nov 28, 2012
View
17 ...nts-graph-sail/src/test/java/com/tinkerpop/blueprints/oupls/sail/OrientGraphSailTest.java
@@ -1,26 +1,39 @@
package com.tinkerpop.blueprints.oupls.sail;
+import com.orientechnologies.orient.core.db.graph.OGraphDatabase;
+import com.tinkerpop.blueprints.KeyIndexableGraph;
+import com.tinkerpop.blueprints.impls.orient.OrientGraph;
import static org.junit.Assert.assertTrue;
/**
* @author Joshua Shinavier (http://fortytwo.net)
*/
-public class OrientGraphSailTest {//extends GraphSailTest {
+public class OrientGraphSailTest {//} extends GraphSailTest {
public void testTrue() {
assertTrue(true);
}
/*
+ The following code properly opens/closes the database.
+ UNCOMMENT once the following is resolved: GraphSail is using a period in the key name of a property,
+ specifically "default.namespace". OrientDB does not allow a period in the key name. If that can be changed
+ the tests will pass. For example, if changed to "default-namespace" all tests across all graphs pass.
public KeyIndexableGraph createGraph() {
String directory = getWorkingDirectory();
+
+ OGraphDatabase db = new OGraphDatabase("local:" + directory + "/graph");
+
+ if( db.exists())
+ db.open("admin", "admin").drop();
+
OrientGraph g = new OrientGraph("local:" + directory + "/graph");
return g;
}
private String getWorkingDirectory() {
return this.computeTestDataRoot().getAbsolutePath();
}
- //*/
+ */
}

0 comments on commit b16945f

Please sign in to comment.