Changeset 654 for trunk/test
- Timestamp:
- Jul 15, 2010, 2:26:48 PM (11 years ago)
- Location:
- trunk/test/integration/gscf
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/integration/gscf/SampleTests.groovy
r653 r654 55 55 assert samplingEvent.validate() 56 56 57 assert samplingEvent.save(flush:true) 57 58 58 59 // Look up sample template … … 109 110 assert study 110 111 111 // Test giveSampl ingEventTemplates112 def templates = study.giveSampl ingEventTemplates()112 // Test giveSampleTemplates 113 def templates = study.giveSampleTemplates() 113 114 assert templates 114 115 assert templates.size() == 1 115 assert templates 116 assert templates.asList().first().name == testSampleTemplateName 116 117 117 118 // Test if the sample is in the samples collection … … 119 120 assert study.samples.size() == 1 120 121 assert study.samples.first().name == testSampleName 122 } 123 124 125 void testParentStudy() { 126 def sample = Sample.findByName(testSampleName) 127 assert sample 128 129 assert sample.parent 130 assert sample.parent.code == testStudyCode 131 } 132 133 void testSampleUniqueNameConstraint() { 134 def sample = Sample.findByName(testSampleName) 135 assert sample 136 137 def study = sample.parent 138 assert study 139 140 def sample2 = new Sample( 141 name: testSampleName, 142 template: sampleTemplate, 143 parentEvent: samplingEvent 144 ) 145 146 // Add the sample to the retrieved parent study 147 study.addToSamples(sample2) 148 149 // At this point, the sample should not validate or save, because there is already a sample with that name in the study 150 assert !sample2.validate() 151 assert !sample2.save(flush:true) 152 121 153 } 122 154 … … 134 166 135 167 void testDomainFields() { 136 def sample = Sample.findByName(testS tudyName)168 def sample = Sample.findByName(testSampleName) 137 169 assert sample 138 170 -
trunk/test/integration/gscf/StudyTests.groovy
r653 r654 99 99 100 100 // Delete the created study 101 def study = Study.findByCode(testStudyCode)101 /*def study = Study.findByCode(testStudyCode) 102 102 assert study 103 103 104 104 study.delete() 105 105 assert Study.findByCode(testStudyCode) == null 106 106 */ 107 107 super.tearDown() 108 108 }
Note: See TracChangeset
for help on using the changeset viewer.