use of com.evolveum.midpoint.prism.impl.xnode.ListXNodeImpl in project midpoint by Evolveum.
the class PerfTestPrismObjectSize method generateTestObject.
private static final RootXNode generateTestObject(int count, int conflicts, boolean withIds) throws SchemaException, IOException {
@NotNull PrismObject<UserType> baseObject = getJack();
@NotNull RootXNode rootNode = getPrismContext().xnodeSerializer().serialize(baseObject);
MapXNodeImpl user = (MapXNodeImpl) rootNode.getSubnode();
ListXNodeImpl assignments = new ListXNodeImpl();
int unique = count - conflicts;
List<String> uuids = generateUUIDs(unique);
for (int i = 0; i < unique; i++) {
assignments.add(createXNodeAssignment(uuids.get(i), withIds ? i : -1));
}
for (int i = 0; i < conflicts; i++) {
int id = unique - 1 - i;
assignments.add(createXNodeAssignment(uuids.get(id), withIds ? id : -1));
}
user.put(UserType.F_ASSIGNMENT, assignments);
return rootNode;
}
Aggregations