use of com.evolveum.midpoint.schema.util.task.TaskInformation in project midpoint by Evolveum.
the class TestMiscTasks method test110DeleteReportDataAgain.
/**
* MID-7277
*/
@Test
public void test110DeleteReportDataAgain() throws Exception {
given();
Task task = getTestTask();
OperationResult result = task.getResult();
when();
suspendAndDeleteTasks(TASK_DELETE_REPORT_DATA.oid);
addTask(TASK_DELETE_REPORT_DATA, result);
waitForTaskCloseOrSuspend(TASK_DELETE_REPORT_DATA.oid, 10000);
then();
TaskType taskAfter = assertTask(TASK_DELETE_REPORT_DATA.oid, "after").display().assertSuccess().assertClosed().assertProgress(0).getObjectable();
TaskInformation information = TaskInformation.createForTask(taskAfter, taskAfter);
assertThat(information).isInstanceOf(ActivityBasedTaskInformation.class);
assertThat(information.getProgressDescriptionShort()).as("progress description").isEqualTo("0");
}
use of com.evolveum.midpoint.schema.util.task.TaskInformation in project midpoint by Evolveum.
the class TestMiscTasks method test100DeleteReportData.
/**
* MID-7277
*/
@Test
public void test100DeleteReportData() throws Exception {
given();
Task task = getTestTask();
OperationResult result = task.getResult();
ReportDataType reportData = new ReportDataType(PrismContext.get()).name("waste data");
repoAddObject(reportData.asPrismObject(), result);
when();
addTask(TASK_DELETE_REPORT_DATA, result);
waitForTaskCloseOrSuspend(TASK_DELETE_REPORT_DATA.oid, 10000);
then();
TaskType taskAfter = assertTask(TASK_DELETE_REPORT_DATA.oid, "after").display().assertSuccess().assertClosed().assertProgress(1).getObjectable();
TaskInformation information = TaskInformation.createForTask(taskAfter, taskAfter);
assertThat(information).isInstanceOf(ActivityBasedTaskInformation.class);
assertThat(information.getProgressDescriptionShort()).as("progress description").isEqualTo("100.0%");
assertNoRepoObject(ReportDataType.class, reportData.getOid());
}
use of com.evolveum.midpoint.schema.util.task.TaskInformation in project midpoint by Evolveum.
the class TaskTablePanel method createTaskStatusIconColumn.
private IconColumn<SelectableBean<TaskType>> createTaskStatusIconColumn() {
return new IconColumn<>(createStringResource("pageTasks.task.status"), TaskType.F_RESULT_STATUS.getLocalPart()) {
@Override
protected DisplayType getIconDisplayType(final IModel<SelectableBean<TaskType>> rowModel) {
TaskInformation taskInformation = getAttachedTaskInformation(rowModel.getObject());
OperationResultStatusType status = taskInformation.getResultStatus();
String icon = OperationResultStatusPresentationProperties.parseOperationalResultStatus(status).getIcon() + " fa-lg";
String title = createStringResource(status).getString();
return GuiDisplayTypeUtil.createDisplayType(icon, "", title);
}
};
}
use of com.evolveum.midpoint.schema.util.task.TaskInformation in project midpoint by Evolveum.
the class TaskTablePanel method createNodesColumn.
private AbstractColumn<SelectableBean<TaskType>, String> createNodesColumn() {
return new AbstractColumn<>(createStringResource("pageTasks.task.executingAt")) {
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<TaskType>>> cellItem, String componentId, IModel<SelectableBean<TaskType>> rowModel) {
TaskInformation taskInformation = getAttachedTaskInformation(rowModel.getObject());
cellItem.add(new Label(componentId, taskInformation.getNodesDescription()));
}
};
}
use of com.evolveum.midpoint.schema.util.task.TaskInformation in project midpoint by Evolveum.
the class TaskTablePanel method createErrorsColumn.
private AbstractColumn<SelectableBean<TaskType>, String> createErrorsColumn() {
return new AbstractColumn<>(createStringResource("pageTasks.task.errors")) {
@Override
public void populateItem(Item<ICellPopulator<SelectableBean<TaskType>>> cellItem, String componentId, IModel<SelectableBean<TaskType>> rowModel) {
TaskInformation taskInformation = getAttachedTaskInformation(rowModel.getObject());
cellItem.add(new Label(componentId, taskInformation.getAllErrors()));
}
};
}
Aggregations