use of com.evolveum.midpoint.task.api.test.NullTaskImpl in project midpoint by Evolveum.
the class MappingTestEvaluator method evaluateMapping.
public <T> PrismValueDeltaSetTriple<PrismPropertyValue<T>> evaluateMapping(String filename, String testName, ItemName defaultTargetPropertyName) throws SchemaException, IOException, ExpressionEvaluationException, ObjectNotFoundException, EncryptionException, SecurityViolationException, ConfigurationException, CommunicationException {
MappingImpl<PrismPropertyValue<T>, PrismPropertyDefinition<T>> mapping = createMapping(filename, testName, defaultTargetPropertyName, null);
OperationResult opResult = new OperationResult(testName);
mapping.evaluate(new NullTaskImpl(), opResult);
assertResult(opResult);
PrismValueDeltaSetTriple<PrismPropertyValue<T>> outputTriple = mapping.getOutputTriple();
if (outputTriple != null) {
outputTriple.checkConsistence();
}
return outputTriple;
}
use of com.evolveum.midpoint.task.api.test.NullTaskImpl in project midpoint by Evolveum.
the class TestExpressionUtil method resolvePath.
private <T> T resolvePath(String path, VariablesMap variables, String exprShortDesc) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
OperationResult result = createOperationResult();
ItemPath itemPath = toItemPath(path);
// WHEN
ObjectResolver objectResolver = new DirectoryFileObjectResolver(MidPointTestConstants.OBJECTS_DIR);
Object resolved = ExpressionUtil.resolvePathGetValue(itemPath, variables, false, null, objectResolver, PrismTestUtil.getPrismContext(), exprShortDesc, new NullTaskImpl(), result);
// THEN
IntegrationTestTools.display("Resolved", resolved);
// noinspection unchecked
return (T) resolved;
}
use of com.evolveum.midpoint.task.api.test.NullTaskImpl in project midpoint by Evolveum.
the class MappingTestEvaluator method evaluateMappingDynamicReplace.
public <T, I> PrismValueDeltaSetTriple<PrismPropertyValue<T>> evaluateMappingDynamicReplace(String filename, String testName, String defaultTargetPropertyName, ItemPath changedPropertyName, I... valuesToReplace) throws SchemaException, IOException, ExpressionEvaluationException, ObjectNotFoundException, EncryptionException, SecurityViolationException, ConfigurationException, CommunicationException {
ObjectDelta<UserType> userDelta = prismContext.deltaFactory().object().createModificationReplaceProperty(UserType.class, USER_OLD_OID, changedPropertyName, valuesToReplace);
MappingImpl<PrismPropertyValue<T>, PrismPropertyDefinition<T>> mapping = createMapping(filename, testName, defaultTargetPropertyName, userDelta);
OperationResult opResult = new OperationResult(testName);
mapping.evaluate(new NullTaskImpl(), opResult);
assertResult(opResult);
PrismValueDeltaSetTriple<PrismPropertyValue<T>> outputTriple = mapping.getOutputTriple();
if (outputTriple != null) {
outputTriple.checkConsistence();
}
return outputTriple;
}
use of com.evolveum.midpoint.task.api.test.NullTaskImpl in project midpoint by Evolveum.
the class MappingTestEvaluator method evaluateMappingDynamicAdd.
public <T, I> PrismValueDeltaSetTriple<PrismPropertyValue<T>> evaluateMappingDynamicAdd(String filename, String testName, ItemPath defaultTargetPropertyPath, String changedPropertyName, I... valuesToAdd) throws SchemaException, IOException, ExpressionEvaluationException, ObjectNotFoundException, EncryptionException, SecurityViolationException, ConfigurationException, CommunicationException {
ObjectDelta<UserType> userDelta = prismContext.deltaFactory().object().createModificationAddProperty(UserType.class, USER_OLD_OID, toPath(changedPropertyName), valuesToAdd);
MappingImpl<PrismPropertyValue<T>, PrismPropertyDefinition<T>> mapping = createMapping(filename, testName, defaultTargetPropertyPath, userDelta);
OperationResult opResult = new OperationResult(testName);
mapping.evaluate(new NullTaskImpl(), opResult);
assertResult(opResult);
PrismValueDeltaSetTriple<PrismPropertyValue<T>> outputTriple = mapping.getOutputTriple();
if (outputTriple != null) {
outputTriple.checkConsistence();
}
return outputTriple;
}
use of com.evolveum.midpoint.task.api.test.NullTaskImpl in project midpoint by Evolveum.
the class MappingTestEvaluator method evaluateMappingDynamicDelete.
public <T, I> PrismValueDeltaSetTriple<PrismPropertyValue<T>> evaluateMappingDynamicDelete(String filename, String testName, String defaultTargetPropertyName, String changedPropertyName, I... valuesToAdd) throws SchemaException, IOException, ExpressionEvaluationException, ObjectNotFoundException, EncryptionException, SecurityViolationException, ConfigurationException, CommunicationException {
ObjectDelta<UserType> userDelta = prismContext.deltaFactory().object().createModificationDeleteProperty(UserType.class, USER_OLD_OID, toPath(changedPropertyName), valuesToAdd);
MappingImpl<PrismPropertyValue<T>, PrismPropertyDefinition<T>> mapping = createMapping(filename, testName, defaultTargetPropertyName, userDelta);
OperationResult opResult = new OperationResult(testName);
mapping.evaluate(new NullTaskImpl(), opResult);
assertResult(opResult);
PrismValueDeltaSetTriple<PrismPropertyValue<T>> outputTriple = mapping.getOutputTriple();
if (outputTriple != null) {
outputTriple.checkConsistence();
}
return outputTriple;
}
Aggregations