Skip to content

Commit

Permalink
Fixing intests
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Mar 13, 2017
1 parent 8f545b4 commit 88df388
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 14 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2016 Evolveum
* Copyright (c) 2010-2017 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -588,6 +588,11 @@ public boolean isHeterogeneousListItem() {
return refinedAttributeDefinition.isHeterogeneousListItem();
}

@Override
public void debugDumpShortToString(StringBuilder sb) {
refinedAttributeDefinition.debugDumpShortToString(sb);
}

//endregion

}
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2016 Evolveum
* Copyright (c) 2010-2017 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -143,4 +143,9 @@ public interface ItemDefinition<I extends Item> extends Definition {
@Override
void revive(PrismContext prismContext);

/**
* Used in debugDumping items. Does not need to have name in it as item already has it. Does not need
* to have class as that is just too much info that is almost anytime pretty obvious anyway.
*/
void debugDumpShortToString(StringBuilder sb);
}
Expand Up @@ -430,7 +430,8 @@ public String toString() {
* Used in debugDumping items. Does not need to have name in it as item already has it. Does not need
* to have class as that is just too much info that is almost anytime pretty obvious anyway.
*/
void debugDumpShortToString(StringBuilder sb) {
@Override
public void debugDumpShortToString(StringBuilder sb) {
sb.append(PrettyPrinter.prettyPrint(getTypeName()));
debugMultiplicity(sb);
debugFlags(sb);
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010-2016 Evolveum
* Copyright (c) 2010-2017 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -565,7 +565,7 @@ public String debugDump(int indent) {

if (def != null && DebugUtil.isDetailedDebugDump()) {
sb.append(" def(");
((PrismPropertyDefinitionImpl) def).debugDumpShortToString(sb);
def.debugDumpShortToString(sb);
// if (def.isIndexed() != null) {
// sb.append(def.isIndexed() ? ",i+" : ",i-");
// }
Expand Down
Expand Up @@ -80,6 +80,8 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti

initDummyResourcePirate(RESOURCE_DUMMY_BLACK_NAME, RESOURCE_DUMMY_BLACK_FILE, RESOURCE_DUMMY_BLACK_OID, initTask, initResult);

repoAddObjectFromFile(SECURITY_POLICY_FILE, initResult);

repoAddObjectFromFile(USER_JACK_FILE, true, initResult);
repoAddObjectFromFile(USER_GUYBRUSH_FILE, true, initResult);
}
Expand Down
Expand Up @@ -1132,7 +1132,7 @@ public void test131ModifyUserJackAssignAccount() throws Exception {
TestUtil.assertSuccess("executeChanges result", result);
XMLGregorianCalendar endTime = clock.currentTimeXMLGregorianCalendar();
assertShadowFetchOperationCountIncrement(0);
assertPrismObjectCloneIncrement(63);
assertPrismObjectCloneIncrement(64);

PrismObject<UserType> userJack = getUser(USER_JACK_OID);
display("User after change execution", userJack);
Expand Down
Expand Up @@ -93,7 +93,7 @@ public class TestPreviewChanges extends AbstractInitializedModelIntegrationTest

public static final File TEST_DIR = new File("src/test/resources/preview");

// YELLOW dummy resource has a STRICT dependency on default dummy resource
// LEMON dummy resource has a STRICT dependency on default dummy resource
protected static final File RESOURCE_DUMMY_LEMON_FILE = new File(TEST_DIR, "resource-dummy-lemon.xml");
protected static final String RESOURCE_DUMMY_LEMON_OID = "10000000-0000-0000-0000-000000000504";
protected static final String RESOURCE_DUMMY_LEMON_NAME = "lemon";
Expand Down Expand Up @@ -1264,7 +1264,7 @@ public void test620AddUserCapsize() throws Exception {

}

// testing multiple resources with dependencies (dummy -> dummy yellow)
// testing multiple resources with dependencies (dummy -> dummy lemon)

@Test
public void test630AddUserRogers() throws Exception {
Expand Down Expand Up @@ -1298,7 +1298,7 @@ public void test630AddUserRogers() throws Exception {

ObjectDelta<UserType> userSecondaryDelta = focusContext.getSecondaryDelta();
// inbound from ship (explicitly specified) to organizationalUnit (dummy resource)
// inbound from gossip (computed via outbound) to description (yellow resource)
// inbound from gossip (computed via outbound) to description (lemon resource)
assertEffectualDeltas(userSecondaryDelta, "focus secondary delta", ActivationStatusType.ENABLED, 2);

PrismObject<UserType> finalUser = user.clone();
Expand Down Expand Up @@ -1328,18 +1328,18 @@ public void test630AddUserRogers() throws Exception {
PrismAsserts.assertNoItemDelta(accountSecondaryDelta,
getAttributePath(getDummyResourceObject(), DummyResourceContoller.DUMMY_ACCOUNT_ATTRIBUTE_FULLNAME_NAME));

// YELLOW dummy resource
// LEMON dummy resource
accContext = modelContext.findProjectionContext(
new ResourceShadowDiscriminator(RESOURCE_DUMMY_YELLOW_OID, ShadowKindType.ACCOUNT, null));
assertNotNull("Null model projection context (yellow)", accContext);
new ResourceShadowDiscriminator(RESOURCE_DUMMY_LEMON_OID, ShadowKindType.ACCOUNT, null));
assertNotNull("Null model projection context (lemon)", accContext);

assertEquals("Wrong policy decision", SynchronizationPolicyDecision.ADD, accContext.getSynchronizationPolicyDecision());
accountPrimaryDelta = accContext.getPrimaryDelta();
assertNotNull("No account primary delta (default)", accountPrimaryDelta);
PrismAsserts.assertIsAdd(accountPrimaryDelta);

accountSecondaryDelta = accContext.getSecondaryDelta();
assertNotNull("No account secondary delta (yellow)", accountSecondaryDelta);
assertNotNull("No account secondary delta (lemon)", accountSecondaryDelta);
// administrativeStatus (ENABLED), enableTimestamp, ship (from organizationalUnit), name, gossip, water, iteration, iterationToken, password/value
PrismAsserts.assertModifications(accountSecondaryDelta, 9);
PrismAsserts.assertPropertyReplace(accountSecondaryDelta,
Expand Down
Expand Up @@ -280,7 +280,9 @@ public void initSystem(Task initTask, OperationResult initResult) throws Excepti
@Override
public void postInitSystem(Task initTask, OperationResult initResult) throws Exception {
super.postInitSystem(initTask, initResult);
dummyResourceCollection.resetResources();
if (dummyResourceCollection != null) {
dummyResourceCollection.resetResources();
}
}

protected void startResources() throws Exception {
Expand Down

0 comments on commit 88df388

Please sign in to comment.