Search in sources :

Example 71 with ItemDelta

use of com.evolveum.midpoint.prism.delta.ItemDelta in project midpoint by Evolveum.

the class LookupTableTest method test228AddKeylessRow2.

@Test(expectedExceptions = SchemaException.class)
public void test228AddKeylessRow2() throws Exception {
    OperationResult result = new OperationResult("test228AddKeylessRow2");
    LookupTableRowType row = new LookupTableRowType();
    row.setValue("value");
    List<ItemDelta<?, ?>> modifications = DeltaBuilder.deltaFor(LookupTableType.class, prismContext).item(F_ROW).add(row).asItemDeltas();
    repositoryService.modifyObject(LookupTableType.class, tableOid, modifications, null, result);
}
Also used : OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ItemDelta(com.evolveum.midpoint.prism.delta.ItemDelta) LookupTableRowType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableRowType) LookupTableType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType) Test(org.testng.annotations.Test)

Example 72 with ItemDelta

use of com.evolveum.midpoint.prism.delta.ItemDelta in project midpoint by Evolveum.

the class LookupTableTest method test230ModifyTableAndRow.

@Test
public void test230ModifyTableAndRow() throws Exception {
    OperationResult result = new OperationResult("test230ModifyTableAndRow");
    List<ItemDelta<?, ?>> modifications = DeltaBuilder.deltaFor(LookupTableType.class, prismContext).item(F_NAME).replace(new PolyString("Table 111", "table 111")).item(F_ROW, 2, F_KEY).replace("key 2").asItemDeltas();
    executeAndCheckModification(modifications, result, 1, Arrays.asList("key 2"));
}
Also used : PolyString(com.evolveum.midpoint.prism.polystring.PolyString) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ItemDelta(com.evolveum.midpoint.prism.delta.ItemDelta) LookupTableType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType) Test(org.testng.annotations.Test)

Example 73 with ItemDelta

use of com.evolveum.midpoint.prism.delta.ItemDelta in project midpoint by Evolveum.

the class LookupTableTest method test222ReplaceKeyToNull.

@Test(expectedExceptions = SchemaException.class)
public void test222ReplaceKeyToNull() throws Exception {
    OperationResult result = new OperationResult("test222ReplaceKeyToNull");
    List<ItemDelta<?, ?>> modifications = DeltaBuilder.deltaFor(LookupTableType.class, prismContext).item(F_ROW, 1, F_KEY).replace().asItemDeltas();
    repositoryService.modifyObject(LookupTableType.class, tableOid, modifications, null, result);
}
Also used : OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ItemDelta(com.evolveum.midpoint.prism.delta.ItemDelta) LookupTableType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType) Test(org.testng.annotations.Test)

Example 74 with ItemDelta

use of com.evolveum.midpoint.prism.delta.ItemDelta in project midpoint by Evolveum.

the class LookupTableTest method test226AddKeylessRow.

@Test(expectedExceptions = SchemaException.class)
public void test226AddKeylessRow() throws Exception {
    OperationResult result = new OperationResult("test226AddKeylessRow");
    List<ItemDelta<?, ?>> modifications = DeltaBuilder.deltaFor(LookupTableType.class, prismContext).item(F_ROW).add(new LookupTableRowType()).asItemDeltas();
    repositoryService.modifyObject(LookupTableType.class, tableOid, modifications, null, result);
}
Also used : OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ItemDelta(com.evolveum.midpoint.prism.delta.ItemDelta) LookupTableRowType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableRowType) LookupTableType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType) Test(org.testng.annotations.Test)

Example 75 with ItemDelta

use of com.evolveum.midpoint.prism.delta.ItemDelta in project midpoint by Evolveum.

the class LookupTableTest method test265ReplaceRowsNewId.

@Test
public void test265ReplaceRowsNewId() throws Exception {
    OperationResult result = new OperationResult("test265ReplaceRowsNewId");
    LookupTableRowType rowNoId = new LookupTableRowType(prismContext);
    rowNoId.setKey("key new plus");
    rowNoId.setValue("value now plus");
    List<ItemDelta<?, ?>> modifications = DeltaBuilder.deltaFor(LookupTableType.class, prismContext).item(F_ROW).replace(rowNoId).asItemDeltas();
    executeAndCheckModification(modifications, result, 0, keysOf(rowNoId));
}
Also used : OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ItemDelta(com.evolveum.midpoint.prism.delta.ItemDelta) LookupTableRowType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableRowType) LookupTableType(com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType) Test(org.testng.annotations.Test)

Aggregations

ItemDelta (com.evolveum.midpoint.prism.delta.ItemDelta)185 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)87 Test (org.testng.annotations.Test)66 ArrayList (java.util.ArrayList)64 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)56 Task (com.evolveum.midpoint.task.api.Task)40 ObjectDelta (com.evolveum.midpoint.prism.delta.ObjectDelta)33 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)30 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)26 PropertyDelta (com.evolveum.midpoint.prism.delta.PropertyDelta)21 QName (javax.xml.namespace.QName)21 AbstractInitializedModelIntegrationTest (com.evolveum.midpoint.model.intest.AbstractInitializedModelIntegrationTest)20 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)19 LookupTableType (com.evolveum.midpoint.xml.ns._public.common.common_3.LookupTableType)15 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)15 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)14 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)14 XMLGregorianCalendar (javax.xml.datatype.XMLGregorianCalendar)14 PrismObject (com.evolveum.midpoint.prism.PrismObject)13 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)12