result);
}
@Test
public void testListRecords() throws Exception {
FedoraAPIMMTOM apim = client.getAPIMMTOM();
FileInputStream in =
new FileInputStream(FEDORA_HOME
+ "/client/demo/foxml/local-server-demos/simple-document-demo/obj_demo_31.xml");
ByteArrayOutputStream out = new ByteArrayOutputStream();
StreamUtility.pipeStream(in, out, 4096);
apim.ingest(TypeUtility.convertBytesToDataHandler(out.toByteArray()), FOXML1_1.uri, "for testing");
String request = "/oai?verb=ListRecords&metadataPrefix=oai_dc";
Document result = getXMLQueryResult(client, request);
assertXpathExists("/oai:OAI-PMH/oai:ListRecords/oai:record", result);
request = "/oai?verb=ListRecords&metadataPrefix=oai_dc&from=2000-01-01";
result = getXMLQueryResult(client, request);
assertXpathExists("/oai:OAI-PMH/oai:ListRecords/oai:record", result);
apim.purgeObject("demo:31", "for testing", false);
}