RDF:rdfIDataSource tests

From MozillaWiki
Jump to: navigation, search

Implementing the rdfIDataSource interface comes with the assumption, that your object implements nsIRDFDataSource as well. This is a migration feature, and it will evolve from a strong assumption of rdfIDataSource objects implementing nsIRDFDataSource via a strong assumption of nsIRDFDataSource objects implementing rdfIDataSource to the deprecation of nsIRDFDataSource.

To test your implementation of rdfIDataSource, you want to make sure that

  • VisitAllTriples reports all assertions (rdfTriplesSerializer can help you there);
  • VisitAllSubjects reports all subjects;
  • you clean up correctly if a visitor call fails and report exceptions back to caller;
  • you handle assertions being added/removed during the visit callback (forwarding all calls to the in memory datasource will block assertions during reads, which is OK, but not required);
  • you control memory and time usage during calls to VisitAllFoo, these should scale well.