Skip to content

Commit

Permalink
Integration tests for generic associations (MID-2668)
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed May 19, 2017
1 parent 599c2c5 commit c95dd29
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 77 deletions.
Expand Up @@ -180,10 +180,11 @@ public class AbstractConfiguredModelIntegrationTest extends AbstractModelIntegra

// Orange dummy resource for testing associations with resource-provided referential integrity
// It also have very little outbound expressions and it has some strange inbound expressions.
protected static final String RESOURCE_DUMMY_ORANGE_FILENAME = COMMON_DIR + "/resource-dummy-orange.xml";
protected static final File RESOURCE_DUMMY_ORANGE_FILE = new File(COMMON_DIR, "resource-dummy-orange.xml");
protected static final String RESOURCE_DUMMY_ORANGE_OID = "10000000-0000-0000-0000-000000001104";
protected static final String RESOURCE_DUMMY_ORANGE_NAME = "orange";
protected static final String RESOURCE_DUMMY_ORANGE_NAMESPACE = MidPointConstants.NS_RI;
protected static final QName RESOURCE_DUMMY_ORANGE_ASSOCIATION_CREW_QNAME = new QName(RESOURCE_DUMMY_ORANGE_NAMESPACE, "crew");

protected static final String RESOURCE_DUMMY_SCHEMALESS_FILENAME = COMMON_DIR + "/resource-dummy-schemaless-no-schema.xml";
protected static final String RESOURCE_DUMMY_SCHEMALESS_OID = "ef2bc95b-76e0-59e2-86d6-9999dddd0000";
Expand Down Expand Up @@ -458,6 +459,7 @@ public class AbstractConfiguredModelIntegrationTest extends AbstractModelIntegra
protected static final ItemPath ROLE_EXTENSION_COST_CENTER_PATH = new ItemPath(RoleType.F_EXTENSION, new QName(NS_PIRACY, "costCenter"));

protected static final String DUMMY_ACCOUNT_ATTRIBUTE_SEA_NAME = "sea";
protected static final String DUMMY_ACCOUNT_ATTRIBUTE_MATE_NAME = "mate";

protected static final String INTENT_TEST = "test";
protected static final String INTENT_DUMMY_GROUP = "group";
Expand Down
Expand Up @@ -115,11 +115,6 @@ public class AbstractInitializedModelIntegrationTest extends AbstractConfiguredM
protected ResourceType resourceDummyEmeraldType;
protected PrismObject<ResourceType> resourceDummyEmerald;

protected DummyResource dummyResourceOrange;
protected DummyResourceContoller dummyResourceCtlOrange;
protected ResourceType resourceDummyOrangeType;
protected PrismObject<ResourceType> resourceDummyOrange;

protected DummyResource dummyResourceUpcase;
protected DummyResourceContoller dummyResourceCtlUpcase;
protected ResourceType resourceDummyUpcaseType;
Expand Down Expand Up @@ -200,13 +195,14 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti
resourceDummyEmeraldType = resourceDummyEmerald.asObjectable();
dummyResourceCtlEmerald.setResource(resourceDummyEmerald);

dummyResourceCtlOrange = DummyResourceContoller.create(RESOURCE_DUMMY_ORANGE_NAME, resourceDummyOrange);
dummyResourceCtlOrange.extendSchemaPirate();
dummyResourceOrange = dummyResourceCtlOrange.getDummyResource();
resourceDummyOrange = importAndGetObjectFromFile(ResourceType.class, RESOURCE_DUMMY_ORANGE_FILENAME, RESOURCE_DUMMY_ORANGE_OID, initTask, initResult);
resourceDummyOrangeType = resourceDummyOrange.asObjectable();
dummyResourceCtlOrange.setResource(resourceDummyOrange);

initDummyResource(RESOURCE_DUMMY_ORANGE_NAME, RESOURCE_DUMMY_ORANGE_FILE, RESOURCE_DUMMY_ORANGE_OID,
controller -> {
controller.extendSchemaPirate();
controller.addAttrDef(controller.getDummyResource().getAccountObjectClass(),
DUMMY_ACCOUNT_ATTRIBUTE_MATE_NAME, String.class, false, true);
},
initTask, initResult);

dummyResourceCtlUpcase = DummyResourceContoller.create(RESOURCE_DUMMY_UPCASE_NAME, resourceDummyUpcase);
dummyResourceCtlUpcase.extendSchemaPirate();
dummyResourceUpcase = dummyResourceCtlUpcase.getDummyResource();
Expand Down

0 comments on commit c95dd29

Please sign in to comment.