| Summary: | Add RDF model validation to the OSLC JUnits. | ||
|---|---|---|---|
| Product: | [Technology] Lyo | Reporter: | Paul Slauenwhite <paulslau> |
| Component: | TestSuite | Assignee: | Michael Fiedler <fiedler.mf> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | fiedler.mf, sspeiche |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Resolved by the following commit: http://git.eclipse.org/c/lyo/org.eclipse.lyo.testsuite.git/commit/?id=7bd2bda5d1fd74d33f7327763d9031f811054b41 Thanks Mike. Closing. |
Validate the model after reading (GET) and before creating/updating (PUT/POST). For example: protected void validateModel(Model model) throws Exception { InfModel infmodel = ModelFactory.createRDFSModel(model); ValidityReport validityReport = infmodel.validate(); if (!validityReport.isClean()) { StringBuffer errorMessage = new StringBuffer(); errorMessage.append("Invalid model:"); //$NON-NLS-1$ Iterator<ValidityReport.Report> reports = validityReport.getReports(); while(reports.hasNext()){ errorMessage.append('\n'); errorMessage.append(reports.next().toString()); } Assert.fail(errorMessage.toString()); } }