Changeset 552 for trunk/test
- Timestamp:
- Jun 10, 2010, 1:36:02 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/integration/gscf/OntologyTests.groovy
r496 r552 103 103 /** 104 104 * Ontocat test for debug purposes: show all properties of a certain ontology 105 * Make this method private in order to run it 105 106 */ 106 107 private void testOntocatBioPortalDebug() { … … 111 112 uk.ac.ebi.ontocat.Ontology o = os.getOntology("1005") 112 113 StringBuilder sb = new StringBuilder(); 114 // This is of course a very scary way to getting more information on 'o', but it seems to be the only way to reach codingScheme 113 115 def bean = os.getOntologyBean() 114 116 String codingScheme = bean.codingScheme … … 120 122 } 121 123 sb.append "Bean:\t" + bean.dump() 124 sb.append("Coding scheme: ") 122 125 sb.append(bean.properties['codingScheme']) 123 126 sb.append("\t"); … … 167 170 168 171 // Iterate over all ontologies in OLS 169 os.getOntologies().each { 170 171 // Get bean and extract versionedId 172 def bean = os.ontologyBean 173 def matcher = bean.codingScheme =~ "/(\\d{5})/" 174 assert matcher 175 assert matcher.size() == 1 176 assert matcher[0].size() == 2 177 def versionedId = matcher[0][1] 172 os.getOntologies().each { o -> 178 173 179 174 // Instantiate ontology … … 181 176 name: o.label, 182 177 description: o.description, 183 url: bean.properties['homepage'],178 url: o.properties['homepage'], 184 179 //url: 'http://bioportal.bioontology.org/ontologies/' + versionedId, 185 180 versionNumber: o.versionNumber, 186 181 ncboId: o.ontologyAccession, 187 ncboVersionedId: versionedId182 ncboVersionedId: o.id 188 183 ); 189 184 … … 194 189 //println ontology.dump() 195 190 } 191 192 } 193 194 public void testAddBioPortalOntology() { 195 def ontology = dbnp.data.Ontology.getBioPortalOntology("1005") 196 // Validate and save ontology 197 if (!ontology.validate()) { ontology.errors.each { println it} } 198 assert ontology.validate() 199 assert ontology.save(flush: true) 200 assert Ontology.findByNcboId(1005).name.equals(ontology.name) 196 201 } 197 202 }
Note: See TracChangeset
for help on using the changeset viewer.