Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

neo4j: use native neo4j transaction for tests

  • Loading branch information...
commit bf4912757b9fa8250cb0d0c536673e71d9393ad0 1 parent 0fe2e10
@sarmbruster authored
View
13 grails-datastore-gorm-neo4j/src/test/groovy/org/grails/datastore/gorm/Setup.groovy
@@ -30,14 +30,15 @@ class Setup {
static PORT = 7473
protected final Logger log = LoggerFactory.getLogger(getClass())
- static session
static datastore
static transaction
static server
+ static graphDb
static destroy() {
- transaction.rollback()
- session.nativeInterface.shutdown()
+ transaction.failure()
+ transaction.finish()
+ graphDb.shutdown()
server?.stop()
}
@@ -46,7 +47,6 @@ class Setup {
def ctx = new GenericApplicationContext()
ctx.refresh()
- def graphDb;
if (System.properties.get("gorm_neo4j_test_use_rest")) {
System.setProperty(Config.CONFIG_BATCH_TRANSACTION,"false") // TODO: remove when support for batch has been finished
//System.setProperty(Config.CONFIG_LOG_REQUESTS,"true") // enable for verbose request/response logging
@@ -118,8 +118,7 @@ class Setup {
datastore.applicationContext.addApplicationListener new DomainEventListener(datastore)
datastore.applicationContext.addApplicationListener new AutoTimestampEventListener(datastore)
- session = datastore.connect()
- transaction = session.beginTransaction()
- session
+ transaction = graphDb.beginTx()
+ datastore.connect()
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.