use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCasesStatisticsType in project midpoint by Evolveum.
the class TestCriticalRolesCertification method test910Statistics.
@Test
public void test910Statistics() throws Exception {
final String TEST_NAME = "test910Statistics";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestCriticalRolesCertification.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
TestUtil.displayWhen(TEST_NAME);
AccessCertificationCasesStatisticsType stat = certificationManager.getCampaignStatistics(campaignOid, false, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
display("statistics", stat.asPrismContainerValue());
assertEquals(1, stat.getMarkedAsAccept());
assertEquals(1, stat.getMarkedAsRevoke());
assertEquals(1, stat.getMarkedAsRevokeAndRemedied());
assertEquals(0, stat.getMarkedAsReduce());
assertEquals(0, stat.getMarkedAsReduceAndRemedied());
assertEquals(1, stat.getMarkedAsNotDecide());
assertEquals(3, stat.getWithoutResponse());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCasesStatisticsType in project midpoint by Evolveum.
the class TestCriticalRolesCertification method test220StatisticsAllStages.
@Test
public void test220StatisticsAllStages() throws Exception {
final String TEST_NAME = "test220StatisticsAllStages";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestCriticalRolesCertification.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
TestUtil.displayWhen(TEST_NAME);
AccessCertificationCasesStatisticsType stat = certificationManager.getCampaignStatistics(campaignOid, false, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
display("statistics", stat.asPrismContainerValue());
assertEquals(1, stat.getMarkedAsAccept());
assertEquals(0, stat.getMarkedAsRevoke());
assertEquals(0, stat.getMarkedAsRevokeAndRemedied());
assertEquals(0, stat.getMarkedAsReduce());
assertEquals(0, stat.getMarkedAsReduceAndRemedied());
assertEquals(0, stat.getMarkedAsNotDecide());
assertEquals(5, stat.getWithoutResponse());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCasesStatisticsType in project midpoint by Evolveum.
the class PageCertCampaign method loadStatistics.
private AccessCertificationCasesStatisticsType loadStatistics() {
// todo
OperationResult result = new OperationResult("dummy");
AccessCertificationCasesStatisticsType stat = null;
try {
// todo
Task task = createSimpleTask("dummy");
stat = getCertificationService().getCampaignStatistics(campaignOid, false, task, result);
result.recordSuccessIfUnknown();
} catch (Exception ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get campaign statistics", ex);
result.recordFatalError("Couldn't get campaign statistics.", ex);
}
result.recomputeStatus();
if (!WebComponentUtil.isSuccessOrHandledError(result)) {
showResult(result);
}
return stat;
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCasesStatisticsType in project midpoint by Evolveum.
the class CertHelper method appendStatistics.
public void appendStatistics(StringBuilder sb, AccessCertificationCampaignType campaign, Task task, OperationResult result) {
AccessCertificationCasesStatisticsType stat;
try {
stat = certificationManager.getCampaignStatistics(campaign.getOid(), false, task, result);
} catch (ObjectNotFoundException | SchemaException | SecurityViolationException | ObjectAlreadyExistsException | RuntimeException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Couldn't get campaign statistics", e);
sb.append("Couldn't get campaign statistics because of ").append(e);
return;
}
int all = stat.getMarkedAsAccept() + stat.getMarkedAsRevoke() + stat.getMarkedAsReduce() + stat.getMarkedAsNotDecide() + stat.getWithoutResponse();
sb.append("Number of cases:\t").append(all);
sb.append("\nMarked as ACCEPT:\t").append(stat.getMarkedAsAccept());
sb.append("\nMarked as REVOKE:\t").append(stat.getMarkedAsRevoke()).append(" (remedied: ").append(stat.getMarkedAsRevokeAndRemedied()).append(")");
sb.append("\nMarked as REDUCE:\t").append(stat.getMarkedAsReduce()).append(" (remedied: ").append(stat.getMarkedAsReduceAndRemedied()).append(")");
sb.append("\nMarked as NOT DECIDED:\t").append(stat.getMarkedAsNotDecide());
sb.append("\nNo response:\t\t").append(stat.getWithoutResponse());
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCasesStatisticsType in project midpoint by Evolveum.
the class TestCriticalRolesCertification method test260Statistics.
@Test
public void test260Statistics() throws Exception {
final String TEST_NAME = "test260Statistics";
TestUtil.displayTestTile(this, TEST_NAME);
// GIVEN
Task task = taskManager.createTaskInstance(TestCriticalRolesCertification.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
TestUtil.displayWhen(TEST_NAME);
AccessCertificationCasesStatisticsType stat = certificationManager.getCampaignStatistics(campaignOid, true, task, result);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
display("statistics", stat.asPrismContainerValue());
assertEquals(4, stat.getMarkedAsAccept());
assertEquals(1, stat.getMarkedAsRevoke());
assertEquals(0, stat.getMarkedAsRevokeAndRemedied());
assertEquals(0, stat.getMarkedAsReduce());
assertEquals(0, stat.getMarkedAsReduceAndRemedied());
assertEquals(0, stat.getMarkedAsNotDecide());
assertEquals(1, stat.getWithoutResponse());
}
Aggregations