Search in sources :

Example 1 with DummyResourceContoller

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

the class AbstractImportTest method initSystem.

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
    LOGGER.trace("initSystem");
    super.initSystem(initTask, initResult);
    repoAddObjectFromFile(SECURITY_POLICY_FILE, initResult);
    repoAddObjectFromFile(USER_TEMPLATE_SCHEMA_CONSTRAINTS_FILE, initResult);
    // Just initialize the resource, do NOT import resource definition
    DummyResourceContoller dummyResourceCtl = DummyResourceContoller.create(null);
    dummyResourceCtl.extendSchemaPirate();
    dummyConnector = findConnectorByTypeAndVersion(CONNECTOR_DUMMY_TYPE, CONNECTOR_DUMMY_VERSION, initResult);
    setDefaultObjectTemplate(UserType.COMPLEX_TYPE, "constrained", USER_TEMPLATE_SCHEMA_CONSTRAINTS_OID, initResult);
}
Also used : DummyResourceContoller(com.evolveum.midpoint.test.DummyResourceContoller)

Example 2 with DummyResourceContoller

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

the class TestMultiConnectorResources method initSystem.

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
    super.initSystem(initTask, initResult);
    initDummyResourcePirate(RESOURCE_DUMMY_OPALINE_NAME, RESOURCE_DUMMY_OPALINE_FILE, RESOURCE_DUMMY_OPALINE_OID, initTask, initResult);
    DummyResourceContoller opalineScriptController = DummyResourceContoller.create(RESOURCE_DUMMY_OPALINE_SCRIPT_NAME, getDummyResourceObject(RESOURCE_DUMMY_OPALINE_NAME));
    dummyResourceCollection.initDummyResource(RESOURCE_DUMMY_OPALINE_SCRIPT_NAME, opalineScriptController);
    repoAddObjectFromFile(SECURITY_POLICY_FILE, initResult);
    repoAddObjectFromFile(SECURITY_POLICY_BENEVOLENT_FILE, initResult);
    repoAddObjectFromFile(PASSWORD_POLICY_BENEVOLENT_FILE, initResult);
    repoAddObjectFromFile(USER_JACK_FILE, true, initResult);
    repoAddObjectFromFile(USER_GUYBRUSH_FILE, true, initResult);
}
Also used : DummyResourceContoller(com.evolveum.midpoint.test.DummyResourceContoller)

Example 3 with DummyResourceContoller

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

the class TestDependencies method initDummy.

private void initDummy(String name, Task initTask, OperationResult initResult) throws FileNotFoundException, ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException, ConnectException, SchemaViolationException, ConflictException, ExpressionEvaluationException, InterruptedException {
    String resourceOid = getDummyOid(name);
    DummyResourceContoller resourceCtl = DummyResourceContoller.create(name.toUpperCase());
    resourceCtl.extendSchemaPirate();
    // Expected warnings: dependencies
    PrismObject<ResourceType> resource = importAndGetObjectFromFileIgnoreWarnings(ResourceType.class, getDummyFile(name), resourceOid, initTask, initResult);
    resourceCtl.setResource(resource);
}
Also used : DummyResourceContoller(com.evolveum.midpoint.test.DummyResourceContoller)

Example 4 with DummyResourceContoller

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

the class TestIteration method initSystem.

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
    super.initSystem(initTask, initResult);
    initDummyResourcePirate(RESOURCE_DUMMY_PINK_NAME, RESOURCE_DUMMY_PINK_FILE, RESOURCE_DUMMY_PINK_OID, initTask, initResult);
    initDummyResourcePirate(RESOURCE_DUMMY_VIOLET_NAME, RESOURCE_DUMMY_VIOLET_FILE, RESOURCE_DUMMY_VIOLET_OID, initTask, initResult);
    DummyResourceContoller darkVioletCtl = initDummyResourcePirate(RESOURCE_DUMMY_DARK_VIOLET_NAME, RESOURCE_DUMMY_DARK_VIOLET_FILE, RESOURCE_DUMMY_DARK_VIOLET_OID, initTask, initResult);
    darkVioletCtl.getDummyResource().setSyncStyle(DummySyncStyle.SMART);
    initDummyResourcePirate(RESOURCE_DUMMY_MAGENTA_NAME, RESOURCE_DUMMY_MAGENTA_FILE, RESOURCE_DUMMY_MAGENTA_OID, initTask, initResult);
    initDummyResourceAd(RESOURCE_DUMMY_FUCHSIA_NAME, RESOURCE_DUMMY_FUCHSIA_FILE, RESOURCE_DUMMY_FUCHSIA_OID, initTask, initResult);
    initDummyResource(RESOURCE_DUMMY_ASSOCIATE_NAME, RESOURCE_DUMMY_ASSOCIATE_FILE, RESOURCE_DUMMY_ASSOCIATE_OID, initTask, initResult);
    addObject(USER_TEMPLATE_ITERATION_FILE);
    addObject(USER_TEMPLATE_ITERATION_UNIQUE_EMAIL_FILE);
    addObject(USER_TEMPLATE_ITERATION_ASSOCIATE_FILE);
    addObject(USER_LARGO_FILE);
    assumeAssignmentPolicy(AssignmentPolicyEnforcementType.RELATIVE);
}
Also used : DummyResourceContoller(com.evolveum.midpoint.test.DummyResourceContoller)

Example 5 with DummyResourceContoller

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

the class TestConnectorDummyFake method initSystem.

@Override
public void initSystem(Task initTask, OperationResult initResult) throws Exception {
    // Make sure that the connectors are discovered
    modelService.postInit(initResult);
    // Make sure to call postInit first. This add system config to repo.
    // If system is initialized after that then the logging config from system config
    // will be used instead of test logging config
    super.initSystem(initTask, initResult);
    DummyResourceContoller dummyResourceCtl = DummyResourceContoller.create(null, resourceDummy);
    dummyResourceCtl.extendSchemaPirate();
    dummyResource = dummyResourceCtl.getDummyResource();
    dummyResourceCtl.addAccount(ACCOUNT_HERMAN_DUMMY_USERNAME, "Herman Toothrot");
    dummyResourceCtl.addAccount(ACCOUNT_GUYBRUSH_DUMMY_USERNAME, "Guybrush Threepwood");
    dummyResourceCtl.addAccount(ACCOUNT_JACK_DUMMY_USERNAME, "Jack Sparrow");
}
Also used : DummyResourceContoller(com.evolveum.midpoint.test.DummyResourceContoller)

Aggregations

DummyResourceContoller (com.evolveum.midpoint.test.DummyResourceContoller)12 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 Task (com.evolveum.midpoint.task.api.Task)2 Test (org.testng.annotations.Test)2 DummyResource (com.evolveum.icf.dummy.resource.DummyResource)1 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)1 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 FileNotFoundException (java.io.FileNotFoundException)1 ConnectException (java.net.ConnectException)1