Skip to content
This repository
Browse code

* CouchDB Record was running tests in parallel, and were failing. Now…

… they run and pass

* Some mongodb/mongodb-record tests were failing because of the change to S.??
  • Loading branch information...
commit 25cfda30cff0a0fef101bdd66b217d1345cf7937 1 parent a53d59f
Diego Medina authored July 03, 2012
113  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoRecordExamplesSpec.scala
@@ -32,6 +32,7 @@ import org.specs.Specification
32 32
 
33 33
 import com.mongodb._
34 34
 import org.bson.types.ObjectId
  35
+import http.{S, LiftSession}
35 36
 
36 37
 
37 38
 package mongotestrecords {
@@ -240,66 +241,70 @@ object MongoRecordExamplesSpec extends Specification("MongoRecordExamples Specif
240 241
   import mongotestrecords._
241 242
   import net.liftweb.util.TimeHelpers._
242 243
 
  244
+  val session = new LiftSession("hello", "", Empty)
243 245
   "TstRecord example" in {
244 246
 
245 247
     checkMongoIsRunning
246 248
 
247  
-    val pwd = "test"
248  
-    val cal = Calendar.getInstance
249  
-    cal.set(2009, 10, 2)
250  
-
251  
-    val tr = TstRecord.createRecord
252  
-    tr.stringfield("test record string field")
253  
-    tr.emailfield("test")
254  
-    tr.validate.size must_== 2
255  
-    tr.passwordfield.setPassword(pwd)
256  
-    tr.emailfield("test@example.com")
257  
-    tr.datetimefield(cal)
258  
-    tr.patternfield(Pattern.compile("^Mo", Pattern.CASE_INSENSITIVE))
259  
-    tr.validate.size must_== 0
260  
-
261  
-    // JsonObjectField
262  
-    val dob1 = Calendar.getInstance.setYear(2005).setMonth(7).setDay(4)
263  
-    val per = Person("joe", 27, Address("Bulevard", "Helsinki"), List(Child("Mary", 5, Some(dob1.getTime)), Child("Mazy", 3, None)))
264  
-    tr.person(per)
265  
-
266  
-    // save the record in the db
267  
-    tr.save
268  
-
269  
-    // retrieve from db
270  
-    def fromDb = TstRecord.find("_id", tr.id)
271  
-
272  
-    fromDb.isDefined must_== true
273  
-
274  
-    for (t <- fromDb) {
275  
-      t._id.value must_== tr._id.value
276  
-      t.booleanfield.value must_== tr.booleanfield.value
277  
-      TstRecord.formats.dateFormat.format(t.datetimefield.value.getTime) must_==
278  
-      TstRecord.formats.dateFormat.format(tr.datetimefield.value.getTime)
279  
-      t.doublefield.value must_== tr.doublefield.value
280  
-      t.intfield.value must_== tr.intfield.value
281  
-      t.localefield.value must_== tr.localefield.value
282  
-      t.longfield.value must_== tr.longfield.value
283  
-      t.passwordfield.isMatch(pwd) must_== true
284  
-      t.stringfield.value must_== tr.stringfield.value
285  
-      t.timezonefield.value must_== tr.timezonefield.value
286  
-      t.datetimefield.value must_== tr.datetimefield.value
287  
-      t.patternfield.value.pattern must_== tr.patternfield.value.pattern
288  
-      t.patternfield.value.flags must_== tr.patternfield.value.flags
289  
-      t.datefield.value must_== tr.datefield.value
290  
-      t.person.value.name must_== tr.person.value.name
291  
-      t.person.value.age must_== tr.person.value.age
292  
-      t.person.value.address.street must_== tr.person.value.address.street
293  
-      t.person.value.address.city must_== tr.person.value.address.city
294  
-      t.person.value.children.size must_== tr.person.value.children.size
295  
-      for (i <- List.range(0, t.person.value.children.size-1)) {
296  
-        t.person.value.children(i).name must_== tr.person.value.children(i).name
297  
-        t.person.value.children(i).age must_== tr.person.value.children(i).age
298  
-        t.person.value.children(i).birthdate must_== tr.person.value.children(i).birthdate
  249
+    S.initIfUninitted(session){
  250
+
  251
+      val pwd = "test"
  252
+      val cal = Calendar.getInstance
  253
+      cal.set(2009, 10, 2)
  254
+
  255
+      val tr = TstRecord.createRecord
  256
+      tr.stringfield("test record string field")
  257
+      tr.emailfield("test")
  258
+      tr.validate.size must_== 2
  259
+      tr.passwordfield.setPassword(pwd)
  260
+      tr.emailfield("test@example.com")
  261
+      tr.datetimefield(cal)
  262
+      tr.patternfield(Pattern.compile("^Mo", Pattern.CASE_INSENSITIVE))
  263
+      tr.validate.size must_== 0
  264
+
  265
+      // JsonObjectField
  266
+      val dob1 = Calendar.getInstance.setYear(2005).setMonth(7).setDay(4)
  267
+      val per = Person("joe", 27, Address("Bulevard", "Helsinki"), List(Child("Mary", 5, Some(dob1.getTime)), Child("Mazy", 3, None)))
  268
+      tr.person(per)
  269
+
  270
+      // save the record in the db
  271
+      tr.save
  272
+
  273
+      // retrieve from db
  274
+      def fromDb = TstRecord.find("_id", tr.id)
  275
+
  276
+      fromDb.isDefined must_== true
  277
+
  278
+      for (t <- fromDb) {
  279
+        t._id.value must_== tr._id.value
  280
+        t.booleanfield.value must_== tr.booleanfield.value
  281
+        TstRecord.formats.dateFormat.format(t.datetimefield.value.getTime) must_==
  282
+        TstRecord.formats.dateFormat.format(tr.datetimefield.value.getTime)
  283
+        t.doublefield.value must_== tr.doublefield.value
  284
+        t.intfield.value must_== tr.intfield.value
  285
+        t.localefield.value must_== tr.localefield.value
  286
+        t.longfield.value must_== tr.longfield.value
  287
+        t.passwordfield.isMatch(pwd) must_== true
  288
+        t.stringfield.value must_== tr.stringfield.value
  289
+        t.timezonefield.value must_== tr.timezonefield.value
  290
+        t.datetimefield.value must_== tr.datetimefield.value
  291
+        t.patternfield.value.pattern must_== tr.patternfield.value.pattern
  292
+        t.patternfield.value.flags must_== tr.patternfield.value.flags
  293
+        t.datefield.value must_== tr.datefield.value
  294
+        t.person.value.name must_== tr.person.value.name
  295
+        t.person.value.age must_== tr.person.value.age
  296
+        t.person.value.address.street must_== tr.person.value.address.street
  297
+        t.person.value.address.city must_== tr.person.value.address.city
  298
+        t.person.value.children.size must_== tr.person.value.children.size
  299
+        for (i <- List.range(0, t.person.value.children.size-1)) {
  300
+          t.person.value.children(i).name must_== tr.person.value.children(i).name
  301
+          t.person.value.children(i).age must_== tr.person.value.children(i).age
  302
+          t.person.value.children(i).birthdate must_== tr.person.value.children(i).birthdate
  303
+        }
299 304
       }
300  
-    }
301 305
 
302  
-    if (!debug) TstRecord.drop
  306
+      if (!debug) TstRecord.drop
  307
+    }
303 308
   }
304 309
 
305 310
   "Ref example" in {
342  persistence/mongodb-record/src/test/scala/net/liftweb/mongodb/record/MongoRecordSpec.scala
@@ -32,12 +32,14 @@ import JsonDSL._
32 32
 import net.liftweb.record.field.Countries
33 33
 
34 34
 import com.mongodb._
  35
+import http.{S, LiftSession}
35 36
 
36 37
 /**
37 38
  * Systems under specification for MongoRecord.
38 39
  */
39 40
 object MongoRecordSpec extends Specification("MongoRecord Specification") with MongoTestKit {
40 41
   import fixtures._
  42
+  val session = new LiftSession("hello", "", Empty)
41 43
 
42 44
   "MongoRecord field introspection" should {
43 45
     checkMongoIsRunning
@@ -328,30 +330,34 @@ object MongoRecordSpec extends Specification("MongoRecord Specification") with M
328 330
     "save and retrieve 'standard' type fields" in {
329 331
       checkMongoIsRunning
330 332
 
331  
-      fttr.save
  333
+      S.initIfUninitted(session) {
  334
+        fttr.save
332 335
 
333  
-      val fttrFromDb = FieldTypeTestRecord.find(fttr.id.value)
334  
-      fttrFromDb must notBeEmpty
335  
-      fttrFromDb foreach { tr =>
336  
-        tr mustEqual fttr
337  
-      }
  336
+        val fttrFromDb = FieldTypeTestRecord.find(fttr.id.value)
  337
+        fttrFromDb must notBeEmpty
  338
+        fttrFromDb foreach { tr =>
  339
+          tr mustEqual fttr
  340
+        }
338 341
 
339  
-      bftr.save
  342
+        bftr.save
340 343
 
341  
-      val bftrFromDb = BinaryFieldTestRecord.find(bftr.id.value)
342  
-      bftrFromDb must notBeEmpty
343  
-      bftrFromDb foreach { tr =>
344  
-        tr mustEqual bftr
  344
+        val bftrFromDb = BinaryFieldTestRecord.find(bftr.id.value)
  345
+        bftrFromDb must notBeEmpty
  346
+        bftrFromDb foreach { tr =>
  347
+          tr mustEqual bftr
  348
+        }
345 349
       }
346 350
     }
347 351
 
348 352
     "delete record properly" in {
349 353
       checkMongoIsRunning
350 354
 
351  
-      fttr.save
352  
-      FieldTypeTestRecord.find(fttr.id.value) must notBeEmpty
353  
-      fttr.delete_!
354  
-      FieldTypeTestRecord.find(fttr.id.value) must beEmpty
  355
+      S.initIfUninitted(session) {
  356
+        fttr.save
  357
+        FieldTypeTestRecord.find(fttr.id.value) must notBeEmpty
  358
+        fttr.delete_!
  359
+        FieldTypeTestRecord.find(fttr.id.value) must beEmpty
  360
+      }
355 361
     }
356 362
 
357 363
     "save and retrieve Mongo type fields with set values" in {
@@ -529,116 +535,119 @@ object MongoRecordSpec extends Specification("MongoRecord Specification") with M
529 535
     "retrieve MongoRef objects properly" in {
530 536
       checkMongoIsRunning
531 537
 
532  
-      val ntr = NullTestRecord.createRecord
533  
-      val btr = BoxTestRecord.createRecord
534  
-
535  
-      fttr.save
536  
-      ltr.save
537  
-      mtr.save
538  
-      ntr.save
539  
-      btr.save
540  
-
541  
-      val rftr = RefFieldTestRecord.createRecord
542  
-        .mandatoryObjectIdRefField(fttr.id.is)
543  
-        .mandatoryUUIDRefField(ltr.id.is)
544  
-        .mandatoryStringRefField(mtr.id.is)
545  
-        .mandatoryIntRefField(ntr.id.is)
546  
-        .mandatoryLongRefField(btr.id.is)
547  
-        .mandatoryObjectIdRefListField(List(fttr.id.is))
548  
-        .mandatoryUUIDRefListField(List(ltr.id.is))
549  
-        .mandatoryStringRefListField(List(mtr.id.is))
550  
-        .mandatoryIntRefListField(List(ntr.id.is))
551  
-        .mandatoryLongRefListField(List(btr.id.is))
552  
-
553  
-      // single objects
554  
-      rftr.mandatoryObjectIdRefField.obj mustEqual Full(fttr)
555  
-      rftr.mandatoryUUIDRefField.obj mustEqual Full(ltr)
556  
-      rftr.mandatoryStringRefField.obj mustEqual Full(mtr)
557  
-      rftr.mandatoryIntRefField.obj mustEqual Full(ntr)
558  
-      rftr.mandatoryLongRefField.obj mustEqual Full(btr)
559  
-
560  
-      val fttr2 = FieldTypeTestRecord.createRecord.save
561  
-
562  
-      rftr.mandatoryObjectIdRefField.cached_? mustEqual true
563  
-      rftr.mandatoryObjectIdRefField(fttr2.id.is)
564  
-      rftr.mandatoryObjectIdRefField.cached_? mustEqual false
565  
-      rftr.mandatoryObjectIdRefField.find mustEqual Full(fttr2)
566  
-      rftr.mandatoryObjectIdRefField.obj mustEqual Full(fttr2)
567  
-      rftr.mandatoryObjectIdRefField.cached_? mustEqual true
568  
-
569  
-      // lists
570  
-      rftr.mandatoryObjectIdRefListField.objs mustEqual List(fttr)
571  
-      rftr.mandatoryUUIDRefListField.objs mustEqual List(ltr)
572  
-      rftr.mandatoryStringRefListField.objs mustEqual List(mtr)
573  
-      rftr.mandatoryIntRefListField.objs mustEqual List(ntr)
574  
-      rftr.mandatoryLongRefListField.objs mustEqual List(btr)
575  
-
576  
-      val fttr3 = FieldTypeTestRecord.createRecord.save
577  
-      val objList = List(fttr2, fttr3)
578  
-
579  
-      rftr.mandatoryObjectIdRefListField.cached_? mustEqual true
580  
-      rftr.mandatoryObjectIdRefListField(objList.map(_.id.is))
581  
-      rftr.mandatoryObjectIdRefListField.cached_? mustEqual false
582  
-      rftr.mandatoryObjectIdRefListField.findAll mustEqual objList
583  
-      rftr.mandatoryObjectIdRefListField.objs mustEqual objList
584  
-      rftr.mandatoryObjectIdRefListField.cached_? mustEqual true
  538
+      S.initIfUninitted(session) {
  539
+        val ntr = NullTestRecord.createRecord
  540
+        val btr = BoxTestRecord.createRecord
  541
+
  542
+        fttr.save
  543
+        ltr.save
  544
+        mtr.save
  545
+        ntr.save
  546
+        btr.save
  547
+
  548
+        val rftr = RefFieldTestRecord.createRecord
  549
+          .mandatoryObjectIdRefField(fttr.id.is)
  550
+          .mandatoryUUIDRefField(ltr.id.is)
  551
+          .mandatoryStringRefField(mtr.id.is)
  552
+          .mandatoryIntRefField(ntr.id.is)
  553
+          .mandatoryLongRefField(btr.id.is)
  554
+          .mandatoryObjectIdRefListField(List(fttr.id.is))
  555
+          .mandatoryUUIDRefListField(List(ltr.id.is))
  556
+          .mandatoryStringRefListField(List(mtr.id.is))
  557
+          .mandatoryIntRefListField(List(ntr.id.is))
  558
+          .mandatoryLongRefListField(List(btr.id.is))
  559
+
  560
+        // single objects
  561
+        rftr.mandatoryObjectIdRefField.obj mustEqual Full(fttr)
  562
+        rftr.mandatoryUUIDRefField.obj mustEqual Full(ltr)
  563
+        rftr.mandatoryStringRefField.obj mustEqual Full(mtr)
  564
+        rftr.mandatoryIntRefField.obj mustEqual Full(ntr)
  565
+        rftr.mandatoryLongRefField.obj mustEqual Full(btr)
  566
+
  567
+        val fttr2 = FieldTypeTestRecord.createRecord.save
  568
+
  569
+        rftr.mandatoryObjectIdRefField.cached_? mustEqual true
  570
+        rftr.mandatoryObjectIdRefField(fttr2.id.is)
  571
+        rftr.mandatoryObjectIdRefField.cached_? mustEqual false
  572
+        rftr.mandatoryObjectIdRefField.find mustEqual Full(fttr2)
  573
+        rftr.mandatoryObjectIdRefField.obj mustEqual Full(fttr2)
  574
+        rftr.mandatoryObjectIdRefField.cached_? mustEqual true
  575
+
  576
+        // lists
  577
+        rftr.mandatoryObjectIdRefListField.objs mustEqual List(fttr)
  578
+        rftr.mandatoryUUIDRefListField.objs mustEqual List(ltr)
  579
+        rftr.mandatoryStringRefListField.objs mustEqual List(mtr)
  580
+        rftr.mandatoryIntRefListField.objs mustEqual List(ntr)
  581
+        rftr.mandatoryLongRefListField.objs mustEqual List(btr)
  582
+
  583
+        val fttr3 = FieldTypeTestRecord.createRecord.save
  584
+        val objList = List(fttr2, fttr3)
  585
+
  586
+        rftr.mandatoryObjectIdRefListField.cached_? mustEqual true
  587
+        rftr.mandatoryObjectIdRefListField(objList.map(_.id.is))
  588
+        rftr.mandatoryObjectIdRefListField.cached_? mustEqual false
  589
+        rftr.mandatoryObjectIdRefListField.findAll mustEqual objList
  590
+        rftr.mandatoryObjectIdRefListField.objs mustEqual objList
  591
+        rftr.mandatoryObjectIdRefListField.cached_? mustEqual true
  592
+      }
585 593
     }
586 594
 
587 595
     "use defaultValue when field is not present in the database" in {
588 596
       checkMongoIsRunning
589  
-
590  
-      val missingFieldDocId = ObjectId.get
591  
-
592  
-      // create a dbobject with no fields manually
593  
-      val builder = BasicDBObjectBuilder.start
594  
-        .add("_id", missingFieldDocId)
595  
-
596  
-      FieldTypeTestRecord.useColl { coll => coll.save(builder.get) }
597  
-
598  
-      val recFromDb = FieldTypeTestRecord.find(missingFieldDocId)
599  
-
600  
-      recFromDb must notBeEmpty
601  
-
602  
-      recFromDb foreach { r =>
603  
-        r.mandatoryBooleanField.is must_== false
604  
-        r.legacyOptionalBooleanField
605  
-        r.optionalBooleanField.is must beEmpty
606  
-        r.mandatoryCountryField.is must_== Countries.C1
607  
-        r.legacyOptionalCountryField.valueBox must beEmpty
608  
-        r.optionalCountryField.is must beEmpty
609  
-        r.mandatoryDecimalField.is must_== 0.00
610  
-        r.legacyOptionalDecimalField.valueBox must beEmpty
611  
-        r.optionalDecimalField.is must beEmpty
612  
-        r.mandatoryDoubleField.is must_== 0d
613  
-        r.legacyOptionalDoubleField.valueBox must beEmpty
614  
-        r.optionalDoubleField.is must beEmpty
615  
-        r.mandatoryEmailField.is must_== ""
616  
-        r.legacyOptionalEmailField.valueBox must beEmpty
617  
-        r.optionalEmailField.is must beEmpty
618  
-        r.mandatoryEnumField.is must_== MyTestEnum.ONE
619  
-        r.legacyOptionalEnumField.valueBox must beEmpty
620  
-        r.optionalEnumField.is must beEmpty
621  
-        r.mandatoryIntField.is must_== 0
622  
-        r.legacyOptionalIntField.valueBox must beEmpty
623  
-        r.optionalIntField.is must beEmpty
624  
-        r.mandatoryLocaleField.is must_== Locale.getDefault.toString
625  
-        r.legacyOptionalLocaleField.valueBox must beEmpty
626  
-        r.optionalLocaleField.is must beEmpty
627  
-        r.mandatoryLongField.is must_== 0L
628  
-        r.legacyOptionalLongField.valueBox must beEmpty
629  
-        r.optionalLongField.is must beEmpty
630  
-        r.mandatoryPostalCodeField.is must_== ""
631  
-        r.legacyOptionalPostalCodeField.valueBox must beEmpty
632  
-        r.optionalPostalCodeField.is must beEmpty
633  
-        r.mandatoryStringField.is must_== ""
634  
-        r.legacyOptionalStringField.valueBox must beEmpty
635  
-        r.optionalStringField.is must beEmpty
636  
-        r.mandatoryTextareaField.is must_== ""
637  
-        r.legacyOptionalTextareaField.valueBox must beEmpty
638  
-        r.optionalTextareaField.is must beEmpty
639  
-        // r.mandatoryTimeZoneField.is must_== "America/Chicago"
640  
-        r.legacyOptionalTimeZoneField.valueBox must beEmpty
641  
-        r.optionalTimeZoneField.is must beEmpty
  597
+      S.initIfUninitted(session) {
  598
+        val missingFieldDocId = ObjectId.get
  599
+
  600
+        // create a dbobject with no fields manually
  601
+        val builder = BasicDBObjectBuilder.start
  602
+          .add("_id", missingFieldDocId)
  603
+
  604
+        FieldTypeTestRecord.useColl { coll => coll.save(builder.get) }
  605
+
  606
+        val recFromDb = FieldTypeTestRecord.find(missingFieldDocId)
  607
+
  608
+        recFromDb must notBeEmpty
  609
+
  610
+        recFromDb foreach { r =>
  611
+          r.mandatoryBooleanField.is must_== false
  612
+          r.legacyOptionalBooleanField
  613
+          r.optionalBooleanField.is must beEmpty
  614
+          r.mandatoryCountryField.is must_== Countries.C1
  615
+          r.legacyOptionalCountryField.valueBox must beEmpty
  616
+          r.optionalCountryField.is must beEmpty
  617
+          r.mandatoryDecimalField.is must_== 0.00
  618
+          r.legacyOptionalDecimalField.valueBox must beEmpty
  619
+          r.optionalDecimalField.is must beEmpty
  620
+          r.mandatoryDoubleField.is must_== 0d
  621
+          r.legacyOptionalDoubleField.valueBox must beEmpty
  622
+          r.optionalDoubleField.is must beEmpty
  623
+          r.mandatoryEmailField.is must_== ""
  624
+          r.legacyOptionalEmailField.valueBox must beEmpty
  625
+          r.optionalEmailField.is must beEmpty
  626
+          r.mandatoryEnumField.is must_== MyTestEnum.ONE
  627
+          r.legacyOptionalEnumField.valueBox must beEmpty
  628
+          r.optionalEnumField.is must beEmpty
  629
+          r.mandatoryIntField.is must_== 0
  630
+          r.legacyOptionalIntField.valueBox must beEmpty
  631
+          r.optionalIntField.is must beEmpty
  632
+          r.mandatoryLocaleField.is must_== Locale.getDefault.toString
  633
+          r.legacyOptionalLocaleField.valueBox must beEmpty
  634
+          r.optionalLocaleField.is must beEmpty
  635
+          r.mandatoryLongField.is must_== 0L
  636
+          r.legacyOptionalLongField.valueBox must beEmpty
  637
+          r.optionalLongField.is must beEmpty
  638
+          r.mandatoryPostalCodeField.is must_== ""
  639
+          r.legacyOptionalPostalCodeField.valueBox must beEmpty
  640
+          r.optionalPostalCodeField.is must beEmpty
  641
+          r.mandatoryStringField.is must_== ""
  642
+          r.legacyOptionalStringField.valueBox must beEmpty
  643
+          r.optionalStringField.is must beEmpty
  644
+          r.mandatoryTextareaField.is must_== ""
  645
+          r.legacyOptionalTextareaField.valueBox must beEmpty
  646
+          r.optionalTextareaField.is must beEmpty
  647
+          // r.mandatoryTimeZoneField.is must_== "America/Chicago"
  648
+          r.legacyOptionalTimeZoneField.valueBox must beEmpty
  649
+          r.optionalTimeZoneField.is must beEmpty
  650
+        }
642 651
       }
643 652
     }
644 653
 
@@ -655,66 +664,69 @@ object MongoRecordSpec extends Specification("MongoRecord Specification") with M
655 664
     "update dirty fields for a FieldTypeTestRecord" in {
656 665
       checkMongoIsRunning
657 666
 
658  
-      val fttr = FieldTypeTestRecord.createRecord
659  
-        .legacyOptionalStringField("legacy optional string")
660  
-        .optionalStringField("optional string")
661  
-        .save
  667
+      S.initIfUninitted(session) {
  668
+        val fttr = FieldTypeTestRecord.createRecord
  669
+          .legacyOptionalStringField("legacy optional string")
  670
+          .optionalStringField("optional string")
  671
+          .save
662 672
 
663  
-      fttr.mandatoryBooleanField(true)
664  
-      fttr.mandatoryBooleanField.dirty_? must_== true
  673
+        fttr.mandatoryBooleanField(true)
  674
+        fttr.mandatoryBooleanField.dirty_? must_== true
665 675
 
666  
-      fttr.mandatoryDecimalField(BigDecimal("3.14"))
667  
-      fttr.mandatoryDecimalField.dirty_? must_== true
  676
+        fttr.mandatoryDecimalField(BigDecimal("3.14"))
  677
+        fttr.mandatoryDecimalField.dirty_? must_== true
668 678
 
669  
-      fttr.mandatoryDoubleField(1999)
670  
-      fttr.mandatoryDoubleField.dirty_? must_== true
  679
+        fttr.mandatoryDoubleField(1999)
  680
+        fttr.mandatoryDoubleField.dirty_? must_== true
671 681
 
672  
-      fttr.mandatoryEnumField(MyTestEnum.TWO)
673  
-      fttr.mandatoryEnumField.dirty_? must_== true
  682
+        fttr.mandatoryEnumField(MyTestEnum.TWO)
  683
+        fttr.mandatoryEnumField.dirty_? must_== true
674 684
 
675  
-      fttr.mandatoryIntField(99)
676  
-      fttr.mandatoryIntField.dirty_? must_== true
  685
+        fttr.mandatoryIntField(99)
  686
+        fttr.mandatoryIntField.dirty_? must_== true
677 687
 
678  
-      fttr.mandatoryLongField(100L)
679  
-      fttr.mandatoryLongField.dirty_? must_== true
  688
+        fttr.mandatoryLongField(100L)
  689
+        fttr.mandatoryLongField.dirty_? must_== true
680 690
 
681  
-      fttr.mandatoryStringField("string")
682  
-      fttr.mandatoryStringField.dirty_? must_== true
  691
+        fttr.mandatoryStringField("string")
  692
+        fttr.mandatoryStringField.dirty_? must_== true
683 693
 
684  
-      fttr.optionalStringField(Empty)
685  
-      fttr.optionalStringField.dirty_? must_== true
  694
+        fttr.optionalStringField(Empty)
  695
+        fttr.optionalStringField.dirty_? must_== true
686 696
 
687  
-      fttr.legacyOptionalStringField(Empty)
688  
-      fttr.legacyOptionalStringField.dirty_? must_== true
  697
+        fttr.legacyOptionalStringField(Empty)
  698
+        fttr.legacyOptionalStringField.dirty_? must_== true
689 699
 
690  
-      fttr.dirtyFields.length must_== 9
691  
-      fttr.update
692  
-      fttr.dirtyFields.length must_== 0
  700
+        fttr.dirtyFields.length must_== 9
  701
+        fttr.update
  702
+        fttr.dirtyFields.length must_== 0
693 703
 
694  
-      val fromDb = FieldTypeTestRecord.find(fttr.id.is)
695  
-      fromDb must notBeEmpty
696  
-      fromDb foreach { rec =>
697  
-        rec must_== fttr
698  
-        rec.dirtyFields.length must_== 0
699  
-      }
  704
+        val fromDb = FieldTypeTestRecord.find(fttr.id.is)
  705
+        fromDb must notBeEmpty
  706
+        fromDb foreach { rec =>
  707
+          rec must_== fttr
  708
+          rec.dirtyFields.length must_== 0
  709
+        }
700 710
 
701  
-      val fttr2 = FieldTypeTestRecord.createRecord.save
702 711
 
703  
-      fttr2.legacyOptionalStringField("legacy optional string")
704  
-      fttr2.legacyOptionalStringField.dirty_? must_== true
  712
+        val fttr2 = FieldTypeTestRecord.createRecord.save
705 713
 
706  
-      fttr2.optionalStringField("optional string")
707  
-      fttr2.optionalStringField.dirty_? must_== true
  714
+        fttr2.legacyOptionalStringField("legacy optional string")
  715
+        fttr2.legacyOptionalStringField.dirty_? must_== true
708 716
 
709  
-      fttr2.dirtyFields.length must_== 2
710  
-      fttr2.update
711  
-      fttr2.dirtyFields.length must_== 0
  717
+        fttr2.optionalStringField("optional string")
  718
+        fttr2.optionalStringField.dirty_? must_== true
712 719
 
713  
-      val fromDb2 = FieldTypeTestRecord.find(fttr2.id.is)
714  
-      fromDb2 must notBeEmpty
715  
-      fromDb2 foreach { rec =>
716  
-        rec must_== fttr2
717  
-        rec.dirtyFields.length must_== 0
  720
+        fttr2.dirtyFields.length must_== 2
  721
+        fttr2.update
  722
+        fttr2.dirtyFields.length must_== 0
  723
+
  724
+        val fromDb2 = FieldTypeTestRecord.find(fttr2.id.is)
  725
+        fromDb2 must notBeEmpty
  726
+        fromDb2 foreach { rec =>
  727
+          rec must_== fttr2
  728
+          rec.dirtyFields.length must_== 0
  729
+        }
718 730
       }
719 731
     }
720 732
 
3  project/Build.scala
@@ -139,7 +139,8 @@ object BuildDef extends Build {
139 139
   lazy val couchdb =
140 140
     persistenceProject("couchdb")
141 141
         .dependsOn(record)
142  
-        .settings(libraryDependencies += dispatch_http)
  142
+        .settings(libraryDependencies += dispatch_http,
  143
+                  parallelExecution in Test := false)
143 144
 
144 145
   lazy val squeryl_record =
145 146
     persistenceProject("squeryl-record")

0 notes on commit 25cfda3

Please sign in to comment.
Something went wrong with that request. Please try again.