--- a/src/test/scala/Test.scala Thu Aug 25 14:18:48 2011 -0400
+++ b/src/test/scala/Test.scala Thu Aug 25 15:29:16 2011 -0400
@@ -22,23 +22,34 @@
test("") {
- val workout =
+ val run =
Workout(
activity="http://dbpedia.org/resource/Running",
events=List(
- Event(timestamp=1314049555597L, coordinates=Some((-71.09068298339844,42.361671924591064,Some(66))), status=None),
- Event(timestamp=1314049559622L, coordinates=None, status=Some("pause"))
+ Event(timestamp=1314049555597L, coordinates=Some((-71.09068298339844,42.361671924591064,Some(66))), status=None)
)
)
- val serialized = grater[Workout].asDBObject(workout)
+ val runId = run.id
+ println("runId: " + runId)
- println(serialized)
+ val serialized = grater[Workout].asDBObject(run)
+
+ println("serialized: " + serialized)
val unserialized = grater[Workout].asObject(serialized)
- println(unserialized)
+ println("unserialized: " + unserialized)
+ object WorkoutDAO extends SalatDAO[Workout, ObjectId](collection = MongoConnection("gw42.w3.org", 27017)("test")("workouts"))
+
+ println(WorkoutDAO.insert(run))
+
+ val fromDatabase = WorkoutDAO.findOneByID(runId)
+
+ println("fromDatabase: " + fromDatabase)
+
+
}
}