Search in sources :

Example 11 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class TestDummyItsmIntegration method test000Sanity.

@Test
public void test000Sanity() throws Exception {
    OperationResult result = getTestOperationResult();
    ResourceType repoResource = repositoryService.getObject(ResourceType.class, RESOURCE_DUMMY_ITSM_OID, null, result).asObjectable();
    assertNotNull("No connector ref", repoResource.getConnectorRef());
    String connectorOid = repoResource.getConnectorRef().getOid();
    assertNotNull("No connector ref OID", connectorOid);
    ConnectorType repoConnector = repositoryService.getObject(ConnectorType.class, connectorOid, null, result).asObjectable();
    assertNotNull(repoConnector);
    display("ITSM intetegration connector", repoConnector);
    // Check connector schema
    IntegrationTestTools.assertConnectorSchemaSanity(repoConnector, prismContext);
}
Also used : ConnectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ResourceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType) Test(org.testng.annotations.Test) AbstractConfiguredModelIntegrationTest(com.evolveum.midpoint.model.intest.AbstractConfiguredModelIntegrationTest)

Example 12 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class TestConnectorDummyFake method test010ListConnectors.

@Test
public void test010ListConnectors() throws Exception {
    // GIVEN
    Task task = getTestTask();
    OperationResult result = task.getResult();
    // WHEN
    List<PrismObject<ConnectorType>> connectors = modelService.searchObjects(ConnectorType.class, null, null, task, result);
    // THEN
    display("Connectors", connectors);
    result.computeStatus();
    TestUtil.assertSuccess("getObject result", result);
    assertEquals("Unexpected number of connectors", 13, connectors.size());
    for (PrismObject<ConnectorType> connector : connectors) {
        display("Connector", connector);
        ConnectorType connectorType = connector.asObjectable();
        if (CONNECTOR_DUMMY_TYPE.equals(connectorType.getConnectorType())) {
            String connectorVersion = connectorType.getConnectorVersion();
            if (connectorVersion.contains("fake")) {
                displayValue("Fake Dummy Connector OID", connector.getOid());
                connectorDummyFakeOid = connector.getOid();
            } else {
                displayValue("Dummy Connector OID", connector.getOid());
                connectorDummyOid = connector.getOid();
            }
        }
    }
    assertNotNull("No dummy connector", connectorDummyOid);
    assertNotNull("No fake dummy connector", connectorDummyFakeOid);
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) Task(com.evolveum.midpoint.task.api.Task) ConnectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test)

Example 13 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class TestConnectorDiscovery method test001Connectors.

/**
 * Check whether the connectors were discovered correctly and were added to the repository.
 */
@Test
public void test001Connectors() throws Exception {
    OperationResult result = createOperationResult();
    // WHEN
    when();
    List<PrismObject<ConnectorType>> connectors = repositoryService.searchObjects(ConnectorType.class, null, null, result);
    // THEN
    then();
    assertFalse("No connector found", connectors.isEmpty());
    display("Found " + connectors.size() + " discovered connector");
    assertSuccess(result);
    for (PrismObject<ConnectorType> connector : connectors) {
        ConnectorType conn = connector.asObjectable();
        display("Found connector " + conn, conn);
        // MID-6581
        IntegrationTestTools.assertConnectorSanity(conn);
        IntegrationTestTools.assertConnectorSchemaSanity(conn, prismContext);
    }
    assertEquals("Unexpected number of connectors found", 11, connectors.size());
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) ConnectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AbstractIntegrationTest(com.evolveum.midpoint.test.AbstractIntegrationTest) Test(org.testng.annotations.Test)

Example 14 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class TestConnectorDiscovery method testSearchConnectorSimple.

@Test
public void testSearchConnectorSimple() throws SchemaException {
    OperationResult result = createOperationResult();
    PrismObject<ConnectorType> ldapConnector = findConnectorByType(IntegrationTestTools.LDAP_CONNECTOR_TYPE, result);
    assertEquals("Type does not match", IntegrationTestTools.LDAP_CONNECTOR_TYPE, ldapConnector.asObjectable().getConnectorType());
}
Also used : ConnectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AbstractIntegrationTest(com.evolveum.midpoint.test.AbstractIntegrationTest) Test(org.testng.annotations.Test)

Example 15 with ConnectorType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType in project midpoint by Evolveum.

the class TestConnectorDiscovery method testListConnectors.

@Test
public void testListConnectors() throws Exception {
    Task task = getTestTask();
    OperationResult result = createOperationResult();
    List<PrismObject<ConnectorType>> connectors = provisioningService.searchObjects(ConnectorType.class, null, null, task, result);
    for (PrismObject<ConnectorType> connector : connectors) {
        ConnectorType conn = connector.asObjectable();
        System.out.println(conn.toString());
        System.out.println("connector name: " + conn.getName());
        System.out.println("connector type: " + conn.getConnectorType());
        System.out.println("-----\n");
    }
    assertEquals("Unexpected number of connectors found", 11, connectors.size());
}
Also used : PrismObject(com.evolveum.midpoint.prism.PrismObject) Task(com.evolveum.midpoint.task.api.Task) ConnectorType(com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) AbstractIntegrationTest(com.evolveum.midpoint.test.AbstractIntegrationTest) Test(org.testng.annotations.Test)

Aggregations

ConnectorType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorType)39 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)21 Test (org.testng.annotations.Test)17 PrismObject (com.evolveum.midpoint.prism.PrismObject)13 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)13 Task (com.evolveum.midpoint.task.api.Task)12 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)12 PrismSchema (com.evolveum.midpoint.prism.schema.PrismSchema)8 AbstractIntegrationTest (com.evolveum.midpoint.test.AbstractIntegrationTest)8 SystemException (com.evolveum.midpoint.util.exception.SystemException)8 QName (javax.xml.namespace.QName)7 CommunicationException (com.evolveum.midpoint.util.exception.CommunicationException)6 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)6 AbstractModelIntegrationTest (com.evolveum.midpoint.model.test.AbstractModelIntegrationTest)4 SchemaRegistry (com.evolveum.midpoint.prism.schema.SchemaRegistry)4 ConnectorConfigurationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorConfigurationType)4 ConnectorHostType (com.evolveum.midpoint.xml.ns._public.common.common_3.ConnectorHostType)4 XmlSchemaType (com.evolveum.midpoint.xml.ns._public.common.common_3.XmlSchemaType)4 Element (org.w3c.dom.Element)4 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)3