I'm working on some extensions to the soriento scala wrapper for orientdb.
I'm trying to write some unit tests like this:
implicit val db: ODatabaseDocumentTx = new ODatabaseDocumentTx(
"memory:jsondb")
db.create()
...
db.save(myObj)
...
db.queryBySql[MyObj]("select * from MyObj;")
queryBySql is provided by Soriento.
What I find is that the object saved to the DB has the same identity
(according to System.identityHashCode), as the object loaded (i.e. it was
never serialized -- the same reference is received from the query, as was
saved). Therefore, serialization is not tested.
This makes sense -- presumably the memory database has no need to
serialize. However, my unit tests really need to force serialization to
happen. I get the same result if creating a plocal.
So, what's the best way to set up and tear down an orientdb DB for unit
tests so that serialization happens for saves and loads? (I can't rely on
an external DB since other people will need to run the unit test.)
--
---
You received this message because you are subscribed to the Google Groups
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.