use of com.evolveum.midpoint.prism.impl.delta.builder.DeltaBuilder in project midpoint by Evolveum.
the class PerfTestPrismObjectSize method replaceDelta.
@Test(dataProvider = "combinations")
public void replaceDelta(ContainerTestParams config) throws SchemaException {
for (int maxOps : DELTA_OP_COUNT) {
int opCount = Math.min(config.count, maxOps);
measureDelta(config, monitorName("replace", config.monitorId(), Integer.toString(opCount)), assignments -> {
DeltaBuilder<UserType> delta = new DeltaBuilder<>(UserType.class, getPrismContext());
for (int i = assignments.size() - opCount; i < assignments.size(); i++) {
AssignmentType assignment = assignments.get(i).clone();
assignment.description("Modified");
delta = (DeltaBuilder<UserType>) delta.item(UserType.F_ASSIGNMENT).replace(assignment.asPrismContainerValue());
}
return delta.asObjectDelta("");
});
}
}
use of com.evolveum.midpoint.prism.impl.delta.builder.DeltaBuilder in project midpoint by Evolveum.
the class PerfTestPrismObjectSize method deleteNoIdDelta.
@Test(dataProvider = "combinations")
public void deleteNoIdDelta(ContainerTestParams config) throws SchemaException {
for (int maxOps : DELTA_OP_COUNT) {
int opCount = Math.min(config.count, maxOps);
measureDelta(config, monitorName("delete.no.id", config.monitorId(), Integer.toString(opCount)), assignments -> {
DeltaBuilder<UserType> delta = new DeltaBuilder<>(UserType.class, getPrismContext());
for (int i = assignments.size() - opCount; i < assignments.size(); i++) {
AssignmentType assignment = assignments.get(i).clone();
delta = (DeltaBuilder<UserType>) delta.item(UserType.F_ASSIGNMENT).delete(assignment.asPrismContainerValue());
}
return delta.asObjectDelta("");
});
}
}
use of com.evolveum.midpoint.prism.impl.delta.builder.DeltaBuilder in project midpoint by Evolveum.
the class PerfTestPrismObjectSize method addDelta.
@Test(dataProvider = "combinations")
public void addDelta(ContainerTestParams config) throws SchemaException {
for (int maxOps : DELTA_OP_COUNT) {
int opCount = maxOps;
measureDelta(config, monitorName("add", config.monitorId(), Integer.toString(opCount)), assignments -> {
DeltaBuilder<UserType> delta = new DeltaBuilder<>(UserType.class, getPrismContext());
for (int i = 0; i < opCount; i++) {
AssignmentType assignment = assignments.get(0).clone();
assignment.getConstruction().resourceRef(newUuid(), assignment.getConstruction().getResourceRef().getType());
assignment.setId(null);
delta = (DeltaBuilder<UserType>) delta.item(UserType.F_ASSIGNMENT).add(assignment.asPrismContainerValue());
}
return delta.asObjectDelta("");
});
}
}
use of com.evolveum.midpoint.prism.impl.delta.builder.DeltaBuilder in project midpoint by Evolveum.
the class PerfTestPrismObjectSize method deleteDelta.
@Test(dataProvider = "combinations")
public void deleteDelta(ContainerTestParams config) throws SchemaException {
for (int maxOps : DELTA_OP_COUNT) {
int opCount = Math.min(config.count, maxOps);
measureDelta(config, monitorName("delete", config.monitorId(), Integer.toString(opCount)), assignments -> {
DeltaBuilder<UserType> delta = new DeltaBuilder<>(UserType.class, getPrismContext());
for (int i = assignments.size() - opCount; i < assignments.size(); i++) {
AssignmentType assignment = assignments.get(i).clone();
delta = (DeltaBuilder<UserType>) delta.item(UserType.F_ASSIGNMENT).delete(assignment.asPrismContainerValue());
}
return delta.asObjectDelta("");
});
}
}
Aggregations