Search in sources :

Example 1 with DummyTestResource

use of com.evolveum.midpoint.test.DummyTestResource in project midpoint by Evolveum.

the class SourcesConfiguration method generateDummyTestResources.

private List<DummyTestResource> generateDummyTestResources() {
    List<DummyTestResource> resources = new ArrayList<>();
    for (int i = 0; i < numberOfResources; i++) {
        boolean primary = i == 0;
        String oid = UUID.randomUUID().toString();
        String resourceDefinitionFile = createResourceDefinition(i, oid, primary);
        resources.add(new DummyTestResource(TARGET_DIR, resourceDefinitionFile, oid, getResourceInstance(i), controller -> {
            if (primary) {
                createAttributes(controller, A_SINGLE_NAME, singleValuedMappings, false);
                controller.addAttrDef(controller.getDummyResource().getAccountObjectClass(), A_ROLE, String.class, false, true);
            }
            createAttributes(controller, A_MULTI_NAME, multiValuedMappings, true);
        }));
    }
    return resources;
}
Also used : Collections.emptyList(java.util.Collections.emptyList) SchemaViolationException(com.evolveum.icf.dummy.resource.SchemaViolationException) DummyTestResource(com.evolveum.midpoint.test.DummyTestResource) UUID(java.util.UUID) DummyResourceContoller(com.evolveum.midpoint.test.DummyResourceContoller) File(java.io.File) FileNotFoundException(java.io.FileNotFoundException) DummyObjectClass(com.evolveum.icf.dummy.resource.DummyObjectClass) ArrayList(java.util.ArrayList) ConflictException(com.evolveum.icf.dummy.resource.ConflictException) List(java.util.List) TARGET_DIR(com.evolveum.midpoint.testing.story.sysperf.TestSystemPerformance.TARGET_DIR) Map(java.util.Map) ConnectException(java.net.ConnectException) NotNull(org.jetbrains.annotations.NotNull) TEST_DIR(com.evolveum.midpoint.testing.story.sysperf.TestSystemPerformance.TEST_DIR) DummyTestResource(com.evolveum.midpoint.test.DummyTestResource) ArrayList(java.util.ArrayList)

Example 2 with DummyTestResource

use of com.evolveum.midpoint.test.DummyTestResource in project midpoint by Evolveum.

the class TargetsConfiguration method generateDummyTestResources.

private List<DummyTestResource> generateDummyTestResources() {
    List<DummyTestResource> resources = new ArrayList<>();
    for (int i = 0; i < numberOfResources; i++) {
        String oid = UUID.randomUUID().toString();
        String resourceDefinitionFile = createResourceDefinition(i, oid);
        resources.add(new DummyTestResource(TARGET_DIR, resourceDefinitionFile, oid, getResourceInstance(i), controller -> {
            createAttributes(controller, A_SINGLE_NAME, singleValuedMappings, false);
            createAttributes(controller, A_MULTI_NAME, multiValuedMappings, true);
            controller.addAttrDef(controller.getDummyResource().getAccountObjectClass(), A_MEMBERSHIP, String.class, false, true);
            controller.addAttrDef(controller.getDummyResource().getGroupObjectClass(), DummyGroup.ATTR_MEMBERS_NAME, String.class, false, true);
        }));
    }
    return resources;
}
Also used : TestSystemPerformance(com.evolveum.midpoint.testing.story.sysperf.TestSystemPerformance) DummyGroup(com.evolveum.icf.dummy.resource.DummyGroup) SchemaViolationException(com.evolveum.icf.dummy.resource.SchemaViolationException) UUID(java.util.UUID) DummyTestResource(com.evolveum.midpoint.test.DummyTestResource) DummyResourceContoller(com.evolveum.midpoint.test.DummyResourceContoller) Collectors(java.util.stream.Collectors) File(java.io.File) FileNotFoundException(java.io.FileNotFoundException) ArrayList(java.util.ArrayList) DummyObjectClass(com.evolveum.icf.dummy.resource.DummyObjectClass) List(java.util.List) ConflictException(com.evolveum.icf.dummy.resource.ConflictException) Map(java.util.Map) ConnectException(java.net.ConnectException) NotNull(org.jetbrains.annotations.NotNull) DummyTestResource(com.evolveum.midpoint.test.DummyTestResource) ArrayList(java.util.ArrayList)

Example 3 with DummyTestResource

use of com.evolveum.midpoint.test.DummyTestResource in project midpoint by Evolveum.

the class SourceInitializer method run.

public void run(OperationResult result) throws Exception {
    boolean primary = true;
    for (DummyTestResource resource : resources) {
        initializeResource(resource, result);
        createAccounts(resource, primary);
        primary = false;
    }
}
Also used : DummyTestResource(com.evolveum.midpoint.test.DummyTestResource)

Aggregations

DummyTestResource (com.evolveum.midpoint.test.DummyTestResource)3 ConflictException (com.evolveum.icf.dummy.resource.ConflictException)2 DummyObjectClass (com.evolveum.icf.dummy.resource.DummyObjectClass)2 SchemaViolationException (com.evolveum.icf.dummy.resource.SchemaViolationException)2 DummyResourceContoller (com.evolveum.midpoint.test.DummyResourceContoller)2 File (java.io.File)2 FileNotFoundException (java.io.FileNotFoundException)2 ConnectException (java.net.ConnectException)2 ArrayList (java.util.ArrayList)2 List (java.util.List)2 Map (java.util.Map)2 UUID (java.util.UUID)2 NotNull (org.jetbrains.annotations.NotNull)2 DummyGroup (com.evolveum.icf.dummy.resource.DummyGroup)1 TestSystemPerformance (com.evolveum.midpoint.testing.story.sysperf.TestSystemPerformance)1 TARGET_DIR (com.evolveum.midpoint.testing.story.sysperf.TestSystemPerformance.TARGET_DIR)1 TEST_DIR (com.evolveum.midpoint.testing.story.sysperf.TestSystemPerformance.TEST_DIR)1 Collections.emptyList (java.util.Collections.emptyList)1 Collectors (java.util.stream.Collectors)1