--- a/src/test/scala/Test.scala Thu Aug 25 12:00:40 2011 -0400
+++ b/src/test/scala/Test.scala Thu Aug 25 12:01:12 2011 -0400
@@ -1,6 +1,20 @@
-package org.w3.virtualtrainer
+package org.w3.virtualtrainer.test
-import org.w3.virtualtrainer.model._
+import com.novus.salat._
+import com.novus.salat.global._
+import com.mongodb.casbah.Imports._
+import com.novus.salat.annotations._
+
+import com.novus.salat.dao._
+import com.mongodb.casbah.MongoConnection
+
+case class Workout(@Key("_id") id: ObjectId = new ObjectId,
+ activity:String,
+ events:List[Event])
+
+case class Event(@Key("t") timestamp:Long,
+ @Key("c") coordinates:Option[(Double, Double, Option[Double])],
+ @Key("s") status:Option[String])
import org.scalatest.FunSuite
@@ -17,10 +31,14 @@
)
)
-// val dbo = grater[Record].asDBObject(record)
-//
-// println(dbo)
-//
+ val serialized = grater[Workout].asDBObject(workout)
+
+ println(serialized)
+
+ val unserialized = grater[Workout].asObject(serialized)
+
+ println(unserialized)
+
}
}