use of com.evolveum.midpoint.wf.impl.util.JaxbValueContainer in project midpoint by Evolveum.
the class TestInfrastructure method test100SerializeContext.
@Test(enabled = true)
public void test100SerializeContext() throws Exception {
final String TEST_NAME = "test100SerializeContext";
Task task = createTask(TEST_NAME);
OperationResult result = task.getResult();
LensContext<UserType> context = new LensContext<UserType>(UserType.class, prismContext, provisioningService);
PrismObject<UserType> bill = prismContext.parseObject(USER_BARBOSSA_FILE);
CryptoUtil.encryptValues(protector, bill);
ObjectDelta<UserType> userDelta = ObjectDelta.createAddDelta(bill);
LensFocusContext<UserType> focusContext = context.getOrCreateFocusContext();
focusContext.setPrimaryDelta(userDelta);
LensContextType contextType = context.toLensContextType();
JaxbValueContainer<LensContextType> container = new JaxbValueContainer<LensContextType>(contextType, prismContext);
container.clearActualValue();
System.out.println("XML value = " + container.getXmlValue());
LensContextType contextTypeRetrieved = container.getValue();
LensContext<UserType> contextRetrieved = LensContext.fromLensContextType(contextTypeRetrieved, prismContext, provisioningService, task, result);
assertEquals("Context after serialization/deserialization does not match context before it (object to add is changed)", context.getFocusContext().getPrimaryDelta().getObjectToAdd(), contextRetrieved.getFocusContext().getPrimaryDelta().getObjectToAdd());
}
use of com.evolveum.midpoint.wf.impl.util.JaxbValueContainer in project midpoint by Evolveum.
the class TestInfrastructure method test101SerializeJaxb.
@Test(enabled = true)
public void test101SerializeJaxb() throws Exception {
OperationResult result = new OperationResult("test101SerializeJaxb");
ScheduleType scheduleType = new ScheduleType();
scheduleType.setInterval(100);
JaxbValueContainer<ScheduleType> container = new JaxbValueContainer<ScheduleType>(scheduleType, prismContext);
container.clearActualValue();
System.out.println("XML value = " + container.getXmlValue());
ScheduleType scheduleTypeRetrieved = container.getValue();
assertEquals("Object after serialization/deserialization does not match original one", scheduleType, scheduleTypeRetrieved);
}
Aggregations