Changeset 440
- Timestamp:
- May 19, 2010, 4:39:48 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/integration/gscf/OntologyTests.groovy
r439 r440 35 35 36 36 def ontology = new Ontology( 37 38 39 40 41 42 37 name: testOntologyName, 38 description: testOntologyDescription, 39 url: testOntologyUrl, 40 versionNumber: testOntologyVersionNumber, 41 ncboId: testOntologyNcboId, 42 ncboVersionedId: testOntologyNcboVersionedId 43 43 ); 44 44 45 45 // Validate and save ontology 46 46 assert ontology.validate() 47 assert ontology.save(flush: true)47 assert ontology.save(flush: true) 48 48 } 49 49 … … 55 55 * Test if ontology was properly saved 56 56 */ 57 void testSave 57 void testSave() { 58 58 59 59 // Try to retrieve the ontology and make sure it's the same … … 70 70 71 71 /** 72 * Test saving and retrieving a term within the ontology and test giveTermByName(name) and giveTerms()73 */72 * Test saving and retrieving a term within the ontology and test giveTermByName(name) and giveTerms() 73 */ 74 74 void testTermSave() { 75 75 … … 80 80 // Create a new term 81 81 def term = new Term( 82 83 84 82 name: testTermName, 83 accession: testAccession, 84 ontology: testOntology 85 85 ) 86 86 87 87 assert term.validate() 88 assert term.save(flush: true)88 assert term.save(flush: true) 89 89 90 90 // Try to retrieve the term from the ontology and make sure it's the same … … 102 102 103 103 /** 104 105 104 * Ontocat test for debug purposes: show all properties of a certain ontology 105 */ 106 106 private void testOntocatBioPortalDebug() { 107 107 // Instantiate OLS service … … 114 114 String codingScheme = bean.codingScheme 115 115 sb.append("OntologyBean:\n") 116 sb.append("property codingScheme=" +codingScheme+"\n")116 sb.append("property codingScheme=" + codingScheme + "\n") 117 117 sb.append("Bean.properties:\n") 118 118 bean.properties.each { 119 sb.append(it.key + "=" + it.value +"\n")119 sb.append(it.key + "=" + it.value + "\n") 120 120 } 121 121 sb.append "Bean:\t" + bean.dump() … … 130 130 sb.append("Ontology meta properties:\n") 131 131 o.getVersionNumber() + o.getMetaPropertyValues().each { 132 sb.append(it.name + "=" + it.value +"\n")132 sb.append(it.name + "=" + it.value + "\n") 133 133 } 134 134 sb.append("Ontology properties:\n"); 135 135 o.getProperties().each { 136 sb.append(it.key + "=" + it.value +"\n")136 sb.append(it.key + "=" + it.value + "\n") 137 137 } 138 138 sb.append("Ontology root terms:\n"); … … 179 179 // Instantiate ontology 180 180 def ontology = new Ontology( 181 182 183 184 185 186 187 181 name: o.label, 182 description: o.description, 183 url: bean.properties['homepage'], 184 //url: 'http://bioportal.bioontology.org/ontologies/' + versionedId, 185 versionNumber: o.versionNumber, 186 ncboId: o.ontologyAccession, 187 ncboVersionedId: versionedId 188 188 ); 189 189 190 190 // Validate and save ontology 191 191 assert ontology.validate() 192 assert ontology.save(flush: true)192 assert ontology.save(flush: true) 193 193 194 194 //println ontology.dump() 195 }196 195 } 197 196 }
Note: See TracChangeset
for help on using the changeset viewer.