Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Matus M authored and Matus M committed Dec 9, 2016
2 parents b03661e + de67a22 commit 3d704c5
Show file tree
Hide file tree
Showing 16 changed files with 46 additions and 38 deletions.
Expand Up @@ -81,6 +81,7 @@ public void execute(DelegateExecution execution) {

if (level.getAutomaticallyApproved() != null) {
try {
opTask.setChannel(wfTask.getChannel());
expressionVariables = getDefaultVariables(execution, wfTask, result);
preApproved = evaluateBooleanExpression(level.getAutomaticallyApproved(), expressionVariables, execution, opTask, result);
if (LOGGER.isTraceEnabled()) {
Expand Down
Expand Up @@ -176,7 +176,7 @@ private PrismObject determineRootTaskObject(ModelContext context) {
public WfTask submitRootTask(WfTaskCreationInstruction rootInstruction, Task taskFromModel, WfConfigurationType wfConfigurationType,
OperationResult result)
throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException {
WfTask rootWfTask = wfTaskController.submitWfTask(rootInstruction, determineParentTaskForRoot(taskFromModel), wfConfigurationType, result);
WfTask rootWfTask = wfTaskController.submitWfTask(rootInstruction, determineParentTaskForRoot(taskFromModel), wfConfigurationType, taskFromModel.getChannel(), result);
result.setBackgroundTaskOid(rootWfTask.getTask().getOid());
wfTaskUtil.setRootTaskOidImmediate(taskFromModel, rootWfTask.getTask().getOid(), result);
return rootWfTask;
Expand Down
Expand Up @@ -212,7 +212,7 @@ private HookOperationMode submitTasks(List<PcpChildWfTaskCreationInstruction> in
// TODO CONSIDER THIS... when OID is no longer transferred
instruction.addHandlersAfterWfProcessAtEnd(WfTaskUtil.WAIT_FOR_TASKS_HANDLER_URI, WfPrepareChildOperationTaskHandler.HANDLER_URI);
}
WfTask wfTask = wfTaskController.submitWfTask(instruction, rootWfTask.getTask(), wfConfigurationType, result);
WfTask wfTask = wfTaskController.submitWfTask(instruction, rootWfTask.getTask(), wfConfigurationType, null, result);
wfTasks.add(wfTask);
}

Expand Down
Expand Up @@ -111,7 +111,7 @@ public class WfTaskController {

public WfTask submitWfTask(WfTaskCreationInstruction instruction, WfTask parentWfTask, WfConfigurationType wfConfigurationType,
OperationResult result) throws SchemaException, ObjectNotFoundException {
return submitWfTask(instruction, parentWfTask.getTask(), wfConfigurationType, result);
return submitWfTask(instruction, parentWfTask.getTask(), wfConfigurationType, null, result);
}

/**
Expand All @@ -121,11 +121,11 @@ public WfTask submitWfTask(WfTaskCreationInstruction instruction, WfTask parentW
* @param wfConfigurationType
*/
public WfTask submitWfTask(WfTaskCreationInstruction instruction, Task parentTask, WfConfigurationType wfConfigurationType,
OperationResult result) throws SchemaException, ObjectNotFoundException {
String channelOverride, OperationResult result) throws SchemaException, ObjectNotFoundException {
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Processing start instruction:\n{}", instruction.debugDump());
}
Task task = submitTask(instruction, parentTask, wfConfigurationType, result);
Task task = submitTask(instruction, parentTask, wfConfigurationType, channelOverride, result);
WfTask wfTask = recreateWfTask(task, instruction.getChangeProcessor());
if (!instruction.isNoProcess()) {
startWorkflowProcessInstance(wfTask, instruction, result);
Expand Down Expand Up @@ -173,8 +173,11 @@ public WfTask recreateRootWfTask(Task task) {

//region Working with midPoint tasks

private Task submitTask(WfTaskCreationInstruction instruction, Task parentTask, WfConfigurationType wfConfigurationType, OperationResult result) throws SchemaException, ObjectNotFoundException {
private Task submitTask(WfTaskCreationInstruction instruction, Task parentTask, WfConfigurationType wfConfigurationType, String channelOverride, OperationResult result) throws SchemaException, ObjectNotFoundException {
Task wfTask = instruction.createTask(this, parentTask, wfConfigurationType);
if (channelOverride != null) {
wfTask.setChannel(channelOverride);
}
if (LOGGER.isTraceEnabled()) {
LOGGER.trace("Switching workflow root or child task to background:\n{}", wfTask.debugDump());
}
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2015 Evolveum
* Copyright (c) 2014-2016 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 @@ -38,5 +38,10 @@ public String getPrimaryIdentifierAttributeName() {
protected boolean syncCanDetectDelete() {
return false;
}

@Override
protected boolean isUsingGroupShortcutAttribute() {
return false;
}

}
Expand Up @@ -51,7 +51,7 @@ protected String getLdapBindDn() {

@Override
protected String getLdapBindPassword() {
return "secret123";
return "qwe12345";
}

@Override
Expand Down
Expand Up @@ -115,7 +115,7 @@ public abstract class AbstractAdLdapTest extends AbstractLdapSynchronizationTest
private static final String GROUP_PIRATES_NAME = "pirates";
private static final String GROUP_MELEE_ISLAND_NAME = "Mêlée Island";

protected static final int NUMBER_OF_ACCOUNTS = 16;
protected static final int NUMBER_OF_ACCOUNTS = 25;
private static final String ASSOCIATION_GROUP_NAME = "group";

private static final String NS_EXTENSION = "http://whatever.com/my";
Expand Down Expand Up @@ -604,8 +604,11 @@ public void test182Search2AccountsOffset1SortCn() throws Exception {

SearchResultList<PrismObject<ShadowType>> shadows = doSearch(TEST_NAME, query, 2, task, result);

assertAccountShadow(shadows.get(0), "CN=Adalbert Meduza,OU=evolveum,DC=win,DC=evolveum,DC=com");
assertAccountShadow(shadows.get(1), "CN=Adalbert Meduza1,OU=evolveum,DC=win,DC=evolveum,DC=com");
assertAccountShadow(shadows.get(0), "a5vg a5vg,CN=Users,DC=win,DC=evolveum,DC=com");
assertAccountShadow(shadows.get(1), "CN=Adalbert Meduza,OU=evolveum,DC=win,DC=evolveum,DC=com");

// assertAccountShadow(shadows.get(0), "CN=Adalbert Meduza,OU=evolveum,DC=win,DC=evolveum,DC=com");
// assertAccountShadow(shadows.get(1), "CN=Adalbert Meduza1,OU=evolveum,DC=win,DC=evolveum,DC=com");

assertConnectorOperationIncrement(1);
assertConnectorSimulatedPagingSearchIncrement(0);
Expand Down
Expand Up @@ -163,6 +163,7 @@ public void test000Sanity() throws Exception {
cleanupDelete(toAccountDn(ACCOUNT_HT_UID, ACCOUNT_HT_CN));
cleanupDelete(toAccountDn(ACCOUNT_HTM_UID, ACCOUNT_HTM_CN));
cleanupDelete(toGroupDn(GROUP_MONKEYS_CN));
cleanupDelete(toGroupDn(GROUP_FOOLS_CN));
}

@Test
Expand Down
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2015 Evolveum
* Copyright (c) 2014-2016 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 @@ -29,26 +29,26 @@
*
*/
@Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class })
public class Test389DsDnBacchus extends Abstract389DsDnTest {
public class Test389DsDnPhobos extends Abstract389DsDnTest {


@Override
protected File getResourceFile() {
return new File(getBaseDir(), "resource-dn-bacchus.xml");
return new File(getBaseDir(), "resource-dn-phobos.xml");
}

@Override
public String getStartSystemCommand() {
return getScriptDirectoryName()+"/389ds-bacchus-start";
return getScriptDirectoryName()+"/389ds-phobos-start";
}

@Override
public String getStopSystemCommand() {
return getScriptDirectoryName()+"/389ds-bacchus-stop";
return getScriptDirectoryName()+"/389ds-phobos-stop";
}

@Override
protected String getLdapServerHost() {
return "bacchus.lab.evolveum.com";
return "phobos.lab.evolveum.com";
}
}
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2014-2015 Evolveum
* Copyright (c) 2014-2016 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 @@ -27,27 +27,27 @@
* @author semancik
*
*/
public class Test389DsNsUniqueIdBacchus extends Abstract389DsNsUniqueIdTest {
public class Test389DsNsUniqueIdPhobos extends Abstract389DsNsUniqueIdTest {


@Override
protected File getResourceFile() {
return new File(getBaseDir(), "resource-nsuniqueid-bacchus.xml");
return new File(getBaseDir(), "resource-nsuniqueid-phobos.xml");
}

@Override
public String getStartSystemCommand() {
return getScriptDirectoryName()+"/389ds-bacchus-start";
return getScriptDirectoryName()+"/389ds-phobos-start";
}

@Override
public String getStopSystemCommand() {
return getScriptDirectoryName()+"/389ds-bacchus-stop";
return getScriptDirectoryName()+"/389ds-phobos-stop";
}

@Override
protected String getLdapServerHost() {
return "bacchus.lab.evolveum.com";
return "phobos.lab.evolveum.com";
}

}
Expand Up @@ -27,7 +27,7 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:enc="http://www.w3.org/2001/04/xmlenc#"
xmlns:mr="http://prism.evolveum.com/xml/ns/public/matching-rule-3">
<name>Localhost 389ds</name>
<name>Phobos 389ds</name>
<connectorRef type="ConnectorType">
<filter>
<q:and>
Expand All @@ -44,7 +44,7 @@
xmlns:icfcldap="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.polygon.connector-ldap/com.evolveum.polygon.connector.ldap.LdapConnector">
<icfc:configurationProperties>
<icfcldap:port>2389</icfcldap:port>
<icfcldap:host>bacchus.lab.evolveum.com</icfcldap:host>
<icfcldap:host>phobos.lab.evolveum.com</icfcldap:host>
<icfcldap:baseContext>dc=example,dc=com</icfcldap:baseContext>
<icfcldap:bindDn>cn=idm,ou=Special Users,dc=example,dc=com</icfcldap:bindDn>
<icfcldap:bindPassword><t:clearValue>secret123</t:clearValue></icfcldap:bindPassword>
Expand Down
Expand Up @@ -27,7 +27,7 @@
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:enc="http://www.w3.org/2001/04/xmlenc#"
xmlns:mr="http://prism.evolveum.com/xml/ns/public/matching-rule-3">
<name>Localhost 389ds</name>
<name>Phobos 389ds</name>
<connectorRef type="ConnectorType">
<filter>
<q:and>
Expand All @@ -44,7 +44,7 @@
xmlns:icfcldap="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.polygon.connector-ldap/com.evolveum.polygon.connector.ldap.LdapConnector">
<icfc:configurationProperties>
<icfcldap:port>2389</icfcldap:port>
<icfcldap:host>bacchus.lab.evolveum.com</icfcldap:host>
<icfcldap:host>phobos.lab.evolveum.com</icfcldap:host>
<icfcldap:baseContext>dc=example,dc=com</icfcldap:baseContext>
<icfcldap:bindDn>cn=idm,ou=Special Users,dc=example,dc=com</icfcldap:bindDn>
<icfcldap:bindPassword><t:clearValue>secret123</t:clearValue></icfcldap:bindPassword>
Expand Down
4 changes: 2 additions & 2 deletions testing/conntest/testng-integration.xml
Expand Up @@ -25,8 +25,8 @@
<class name="com.evolveum.midpoint.testing.conntest.TestOpenDj"/>
<class name="com.evolveum.midpoint.testing.conntest.TestOpenDjUnsafe"/>
<class name="com.evolveum.midpoint.testing.conntest.TestOpenDjDumber"/>
<class name="com.evolveum.midpoint.testing.conntest.Test389DsNsUniqueIdBacchus"/>
<class name="com.evolveum.midpoint.testing.conntest.Test389DsDnBacchus"/>
<class name="com.evolveum.midpoint.testing.conntest.Test389DsNsUniqueIdPhobos"/>
<class name="com.evolveum.midpoint.testing.conntest.Test389DsDnPhobos"/>
<class name="com.evolveum.midpoint.testing.conntest.TestEDirDeimos"/>
<class name="com.evolveum.midpoint.testing.conntest.TestAdLdapMedusa"/>
<class name="com.evolveum.midpoint.testing.conntest.TestAdLdapRawMedusa"/>
Expand Down
5 changes: 0 additions & 5 deletions testing/rest/pom.xml
Expand Up @@ -55,11 +55,6 @@
<artifactId>prism</artifactId>
<version>3.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.infra</groupId>
<artifactId>common</artifactId>
<version>3.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.repo</groupId>
<artifactId>repo-api</artifactId>
Expand Down
Expand Up @@ -257,7 +257,7 @@ public void test100AddUserJack() throws Exception {
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "ADD_OBJECT");
tailer.assertAudit(5);
tailer.assertAudit(4);

// GET user
UserType userAfter = getObject(UserType.class, USER_JACK_OID);
Expand Down
Expand Up @@ -402,7 +402,7 @@ public void test120AddUserNobodyAsAdministrator() throws Exception {
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "ADD_OBJECT");
tailer.assertAudit(5);
tailer.assertAudit(4);

// GET user
UserType userNobodyAfter = getObject(UserType.class, userNobodyOid);
Expand Down Expand Up @@ -796,7 +796,7 @@ public void test142DisableHimselfAsDarthAdder() throws Exception {
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "MODIFY_OBJECT");
tailer.assertAudit(5);
tailer.assertAudit(4);

modelPort = createModelPort();
UserType user = getObject(UserType.class, USER_DARTHADDER_OID);
Expand Down Expand Up @@ -882,7 +882,7 @@ public void test146EnableDarthAdder() throws Exception {
assertAuditLoginLogout(tailer);
assertAuditIds(tailer);
assertAuditOperation(tailer, "MODIFY_OBJECT");
tailer.assertAudit(5);
tailer.assertAudit(4);

modelPort = createModelPort(USER_DARTHADDER_USERNAME, USER_DARTHADDER_PASSWORD, WSConstants.PW_DIGEST);
UserType user = getObject(UserType.class, USER_DARTHADDER_OID);
Expand Down

0 comments on commit 3d704c5

Please sign in to comment.