use of com.emc.storageos.db.exceptions.RetryableDatabaseException in project coprhd-controller by CoprHD.
the class DbAuditLogRetrieverTest method auditServiceDBExceptionsTestXML.
@Test
public void auditServiceDBExceptionsTestXML() throws WebApplicationException, IOException, JAXBException {
deleteIfExists(XmlTestOutputFile);
DummyDBClient dbClient = new DummyDBClient();
DbAuditLogRetriever dummyDbAuditLogRetriever = new DbAuditLogRetriever();
dummyDbAuditLogRetriever.setDbClient(dbClient);
String timeBucket = "2012-01-02T00";
AuditLogRequest auditLogRequest = getAuditLogRequest(timeBucket);
MediaType mediaType = MediaType.APPLICATION_XML_TYPE;
File of = new File(XmlTestOutputFile);
OutputStream os = new FileOutputStream(of);
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(os));
try {
dummyDbAuditLogRetriever.getBulkAuditLogs(auditLogRequest, mediaType, out);
} catch (RetryableDatabaseException e) {
Assert.assertTrue(e.toString().contains("I/O"));
} catch (MarshallingExcetion e) {
Assert.fail(e.getMessage());
}
out.close();
}
Aggregations