Skip to content

Commit

Permalink
Added test for serialization of case classes with arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmuss committed Jul 30, 2014
1 parent ffd3ed7 commit b6d554f
Showing 1 changed file with 14 additions and 0 deletions.
Expand Up @@ -16,6 +16,8 @@ case class Test(s: String, i: Int, ji: java.lang.Integer, d: Double, l: Long, b:

case class Test2(jl: java.lang.Long, jd: java.lang.Double, jb: java.lang.Boolean, nullString: String = null)

case class ArrayTest(ar: Array[String])

case class NotTest(s: String, i: Int, ji: java.lang.Integer, d: Double, l: Long, b: Boolean)

trait PolyBase
Expand Down Expand Up @@ -98,6 +100,18 @@ class DeSerializingSpec extends SpecificationWithJUnit with Neo4jWrapper with Em
}
}

"be serializable with ArrayTest" in {
withTx { implicit neo =>
val o = ArrayTest(Array("foo", "bar", "baz", "qux"))
val node = createNode(o)
val oo1: ArrayTest = Neo4jWrapper.deSerialize[ArrayTest](node)
val oo2 = node.toCC[ArrayTest]

oo1.ar must beEqualTo(o.ar)
oo2.get.ar must beEqualTo(o.ar)
}
}

"be serializable with labels" in {
withTx { neo =>
val o = Test2(1, 3.3, true)
Expand Down

0 comments on commit b6d554f

Please sign in to comment.