use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.
the class AtlasMappingBaseTest method printAudit.
protected String printAudit(AtlasSession session) {
StringBuilder buf = new StringBuilder("Audits: ");
for (Audit a : session.getAudits().getAudit()) {
buf.append('[');
buf.append(a.getStatus());
buf.append(", message=");
buf.append(a.getMessage());
buf.append(", path=");
buf.append(a.getPath());
buf.append("], ");
}
return buf.toString();
}
use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.
the class BaseDefaultAtlasContextTest method printAudit.
protected String printAudit(AtlasSession session) {
StringBuilder buf = new StringBuilder("Audits: ");
for (Audit a : session.getAudits().getAudit()) {
buf.append('[');
buf.append(a.getStatus());
buf.append(", message=");
buf.append(a.getMessage());
buf.append("], ");
}
return buf.toString();
}
use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.
the class DefaultAtlasSessionTest method testGetSetAudits.
@Test
public void testGetSetAudits() {
assertNotNull(session.getAudits());
assertNotNull(session.getAudits().getAudit());
assertTrue(session.getAudits().getAudit().size() == 0);
Audits audits = new Audits();
Audit audit = new Audit();
audit.setStatus(AuditStatus.INFO);
audit.setMessage("hello");
audits.getAudit().add(audit);
session.setAudits(audits);
assertNotNull(session.getAudits());
assertNotNull(session.getAudits().getAudit());
assertTrue(session.getAudits().getAudit().size() == 1);
}
use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.
the class DefaultAtlasSessionTest method testAuditErrors.
@Test
public void testAuditErrors() {
assertTrue(session.errorCount() == 0);
assertFalse(session.hasErrors());
assertTrue(session.warnCount() == 0);
assertFalse(session.hasWarns());
Audit error = new Audit();
error.setStatus(AuditStatus.ERROR);
session.getAudits().getAudit().add(error);
assertTrue(session.errorCount() == 1);
assertTrue(session.hasErrors());
assertTrue(session.warnCount() == 0);
assertFalse(session.hasWarns());
}
use of org.alfresco.repo.audit.model._3.Audit in project atlasmap by atlasmap.
the class DefaultAtlasSessionTest method testAuditWarns.
@Test
public void testAuditWarns() {
assertTrue(session.errorCount() == 0);
assertFalse(session.hasErrors());
assertTrue(session.warnCount() == 0);
assertFalse(session.hasWarns());
Audit warn = new Audit();
warn.setStatus(AuditStatus.WARN);
session.getAudits().getAudit().add(warn);
assertTrue(session.errorCount() == 0);
assertFalse(session.hasErrors());
assertTrue(session.warnCount() == 1);
assertTrue(session.hasWarns());
}
Aggregations