//---
// Static helpers
//---
protected static DigitalObject createTestObject(URIReference... contentModelURIs) {
DigitalObject obj = new BasicDigitalObject();
obj.setPid(TEST_PID);
DatastreamXMLMetadata ds = createXDatastream("RELS-EXT");
StringBuilder rdf = new StringBuilder();
rdf
.append("<rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" "
+ "xmlns:fedora-model=\"info:fedora/fedora-system:def/model#\">\n"
+ "<rdf:Description rdf:about=\"");
rdf.append(PID.getInstance(TEST_PID).toURI() + "\">\n");
for (URIReference model : contentModelURIs) {
rdf.append("<fedora-model:hasModel rdf:resource=\""
+ model.getURI().toString()
+ "\"></fedora-model:hasModel>\n");
}
rdf.append("</rdf:Description></rdf:RDF>");
ds.xmlContent = rdf.toString().getBytes();
obj.addDatastreamVersion(ds, false);
obj.setCreateDate(new Date());
obj.setLastModDate(new Date());
obj.setCreateDate(new Date());
obj.setLastModDate(new Date());
return obj;
}