| Summary: | Incorrect null checks after Model.getResource() | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Technology] Lyo | Reporter: | Samuel Padgett <samuel.padgett> | ||||
| Component: | TestSuite | Assignee: | Samuel Padgett <samuel.padgett> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | fiedler.mf, samuel.padgett, sspeiche | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 206369 [details]
Use Model.contains() instead of Model.getResource() to see if a subject is in the model
I updated the tests to match the original intent (checking if the resources are really in the model), and removed the null checks for objects that will never be null.
Resolved by the following commit: http://git.eclipse.org/c/lyo/org.eclipse.lyo.testsuite.git/commit/?id=c1445c5a6612f738eb13901fdfab0e62ae0c4040 Closing... |
Build Identifier: The test suite contains several null tests like this, catalog = (Resource) rdfModel.getResource(currentUrl); assertNotNull("Failed to read Catalog resource at URI: "+currentUrl, catalog); According to the Jena Javadoc, Model.getResource() never returns null, however. http://jena.sourceforge.net/javadoc/com/hp/hpl/jena/rdf/model/Model.html#getResource%28java.lang.String%29 "Return a Resource instance with the given URI in this model. This method behaves identically to createResource(String) and exists as legacy: createResource is now capable of, and allowed to, reuse existing objects." If the resource isn't in the model, it gets created, so the tests are not really checking if the resource is there. Reproducible: Always