Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Sep 29, 2020
2 parents 6b75992 + 719fd80 commit 914eb7e
Show file tree
Hide file tree
Showing 14 changed files with 1,407 additions and 496 deletions.
15 changes: 9 additions & 6 deletions dist/src/main/bin/midpoint.sh
@@ -1,8 +1,10 @@
#!/bin/bash
#!/usr/bin/env bash
# Portions Copyright (C) 2017-2020 Evolveum and contributors
#
# This work is dual-licensed under the Apache License 2.0
# and European Union Public License. See LICENSE file for details.
#
# Script should run on bash 3.2 to allow OS X usage.

set -eu

Expand Down Expand Up @@ -60,7 +62,8 @@ fi
: "${UMASK:="0027"}"
umask ${UMASK}

if [[ ! -v JAVA_HOME ]]; then
# can't use -v here because of bash 3.2 support
if [[ -z "${JAVA_HOME:-}" ]]; then
_RUNJAVA=java
else
_RUNJAVA="${JAVA_HOME}/bin/java"
Expand Down Expand Up @@ -122,13 +125,13 @@ if [[ "$1" == "start" ]]; then
echo "Starting midPoint..."
echo "MIDPOINT_HOME=${MIDPOINT_HOME}"

echo -e "\nStarting at $(date)\nMIDPOINT_HOME=${MIDPOINT_HOME}\nJava binary: ${_RUNJAVA}\nJava version:" &>> "${BOOT_OUT}"
"${_RUNJAVA}" -version &>> "${BOOT_OUT}"
echo &>> "${BOOT_OUT}"
echo -e "\nStarting at $(date)\nMIDPOINT_HOME=${MIDPOINT_HOME}\nJava binary: ${_RUNJAVA}\nJava version:" >>"${BOOT_OUT}"
# can't use &>> here because of bash 3.2 support
"${_RUNJAVA}" -version >>"${BOOT_OUT}" 2>&1

# shellcheck disable=SC2086
eval "${_NOHUP}" "\"${_RUNJAVA}\"" \
${LOGGING_MANAGER} ${JAVA_OPTS} -Dmidpoint.home=${MIDPOINT_HOME}\
${LOGGING_MANAGER} ${JAVA_OPTS} -Dmidpoint.home=${MIDPOINT_HOME} \
-cp "${BASE_DIR}/lib/midpoint.war" \
-Dloader.path=WEB-INF/classes,WEB-INF/lib,WEB-INF/lib-provided,${MIDPOINT_HOME}/lib/ \
org.springframework.boot.loader.PropertiesLauncher \
Expand Down
54 changes: 29 additions & 25 deletions dist/src/main/bin/ninja.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
#
# This work is dual-licensed under the Apache License 2.0
# and European Union Public License. See LICENSE file for details.
Expand All @@ -12,64 +12,68 @@ SCRIPT_PATH=$(cd $(dirname "$0") && pwd -P)/
PRG="$0"

while [ -h "$PRG" ]; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
ls=$(ls -ld "$PRG")
link=$(expr "$ls" : '.*-> \(.*\)$')
if expr "$link" : '/.*' >/dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`/"$link"
PRG=$(dirname "$PRG")/"$link"
fi
done

# Get standard environment variable
PRGDIR=`dirname "$PRG"`
PRGDIR=$(dirname "$PRG")

cd "$PRGDIR/.." >/dev/null

cd "$SCRIPT_PATH/.."

# honor MIDPOINT_HOME variable if it exists!
if [ -z "$MIDPOINT_HOME" ]; then
if [ ! -d var ] ; then
echo "ERROR: midpoint.home directory desn't exist"
exit 1
else
MIDPOINT_HOME=$(cd "$SCRIPT_PATH../var"; pwd)
fi
if [ ! -d var ]; then
echo "ERROR: midpoint.home directory desn't exist"
exit 1
else
MIDPOINT_HOME=$(
cd "$SCRIPT_PATH../var"
pwd
)
fi

[ -z "$MIDPOINT_HOME" ] && MIDPOINT_HOME=`cd "$SCRIPT_PATH../var" >/dev/null; pwd`
[ -z "$MIDPOINT_HOME" ] && MIDPOINT_HOME=$(
cd "$SCRIPT_PATH../var" >/dev/null
pwd
)
fi
#cd "$SCRIPT_PATH../lib"

if [ ! -f lib/ninja.jar ] ; then
echo "ERROR: ninja.jar is not in /lib directory"
exit 1
if [ ! -f lib/ninja.jar ]; then
echo "ERROR: ninja.jar is not in /lib directory"
exit 1
fi

# Set UMASK unless it has been overridden
if [ -z "$UMASK" ]; then
UMASK="0027"
UMASK="0027"
fi
umask $UMASK

if [ -z "$JAVA_HOME" ] ; then
if [ -z "$JAVA_HOME" ]; then
_RUNJAVA=java
else
_RUNJAVA="$JAVA_HOME"/bin/java
fi

while getopts ":j:" opt; do
case $opt in
j)
JDBC_DRIVER=$OPTARG
;;
j)
JDBC_DRIVER=$OPTARG
;;
esac
done

if [ ! -z "$JDBC_DRIVER" ] ; then
JDBC_DRIVER="-Dloader.path=$JDBC_DRIVER"
if [ ! -z "$JDBC_DRIVER" ]; then
JDBC_DRIVER="-Dloader.path=$JDBC_DRIVER"
fi

exec "$_RUNJAVA" $JDBC_DRIVER -jar $SCRIPT_PATH../lib/ninja.jar -m $MIDPOINT_HOME "$@"


2 changes: 1 addition & 1 deletion dist/src/main/bin/start.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (C) 2017-2020 Evolveum and contributors
#
# This work is dual-licensed under the Apache License 2.0
Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/bin/stop.sh
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# Copyright (C) 2017-2020 Evolveum and contributors
#
# This work is dual-licensed under the Apache License 2.0
Expand Down
Expand Up @@ -25,13 +25,13 @@
<div class="form-group col-sm-12">
<label class="col-sm-4"><wicket:message key="ReferencePopupPanel.targetType"/></label>
<div class="col-sm-8">
<select wicket:id="type" class="form-control input-sm" style="width: 150px;"/>
<div wicket:id="type" />
</div>
</div>
<div class="form-group col-sm-12">
<label class="col-sm-4"><wicket:message key="ReferencePopupPanel.relation"/></label>
<div class="col-sm-8">
<select wicket:id="relation" class="form-control input-sm" style="width: 150px;"/>
<div wicket:id="relation" />
</div>
</div>
<div class="form-group col-sm-12">
Expand Down
Expand Up @@ -10,9 +10,12 @@
import java.util.List;
import javax.xml.namespace.QName;

import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
import org.apache.wicket.behavior.AttributeAppender;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.model.IModel;
Expand Down Expand Up @@ -103,9 +106,8 @@ protected void onUpdate(AjaxRequestTarget target) {
nameField.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
add(nameField);

DropDownChoice<QName> type = new DropDownChoice<>(ID_TYPE, new PropertyModel<>(getModel(), "type"),
getSupportedTargetList(), new QNameObjectTypeChoiceRenderer());
type.setNullValid(true);
DropDownChoicePanel<QName> type = new DropDownChoicePanel<QName>(ID_TYPE, new PropertyModel<>(getModel(), "type"),
Model.ofList(getSupportedTargetList()), new QNameObjectTypeChoiceRenderer(), true);
type.setOutputMarkupId(true);
type.add(new VisibleEnableBehaviour() {

Expand All @@ -116,19 +118,14 @@ public boolean isEnabled() {
return getSupportedTargetList().size() > 1;
}
});
type.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
type.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
type.getBaseFormComponent().add(AttributeAppender.append("style", "width: 150px;"));
add(type);

if (getModelObject() != null && getModelObject().getRelation() == null) {
getModelObject().setRelation(PrismConstants.Q_ANY);
}
List<QName> allowedRelations = new ArrayList<>(getAllowedRelations());
if (!allowedRelations.contains(PrismConstants.Q_ANY)) {
allowedRelations.add(0, PrismConstants.Q_ANY);
}
DropDownChoice<QName> relation = new DropDownChoice<>(ID_RELATION,
DropDownChoicePanel<QName> relation = new DropDownChoicePanel<QName>(ID_RELATION,
new PropertyModel<>(getModel(), "relation"),
allowedRelations, new QNameObjectTypeChoiceRenderer());
Model.ofList(allowedRelations), new QNameObjectTypeChoiceRenderer(), true);
relation.setOutputMarkupId(true);
relation.add(new VisibleEnableBehaviour() {

Expand All @@ -139,7 +136,8 @@ public boolean isEnabled() {
return getAllowedRelations().size() > 1;
}
});
relation.add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
relation.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
relation.getBaseFormComponent().add(AttributeAppender.append("style", "width: 150px;"));
add(relation);

AjaxButton confirm = new AjaxButton(ID_CONFIRM_BUTTON, createStringResource("Button.ok")) {
Expand Down
Expand Up @@ -150,8 +150,6 @@ public SearchItem addItem(ItemDefinition def) {
List<QName> supportedTargets = WebComponentUtil.createSupportedTargetTypeList(((PrismReferenceDefinition) def).getTargetTypeName());
if (supportedTargets.size() == 1) {
ref.setType(supportedTargets.iterator().next());
} else {
ref.setType(ObjectType.COMPLEX_TYPE);
}
if (itemToRemove.getAllowedValues() != null && itemToRemove.getAllowedValues().size() == 1) {
ref.setRelation((QName) itemToRemove.getAllowedValues().iterator().next());
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -874,7 +874,7 @@
<dependency>
<groupId>com.evolveum.polygon</groupId>
<artifactId>connector-ldap</artifactId>
<version>3.1-M1</version>
<version>3.1-M2</version>
<exclusions>
<!-- Needed otherwise the JDK14 SLF4J binding can override the midpoint's logback binding -->
<exclusion>
Expand Down
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2015-2019 Evolveum and contributors
*
* This work is dual-licensed under the Apache License 2.0
* and European Union Public License. See LICENSE file for details.
*/
package com.evolveum.midpoint.testing.conntest.ad;

import java.io.File;

import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.annotation.DirtiesContext.ClassMode;
import org.springframework.test.context.ContextConfiguration;
import org.testng.annotations.Listeners;

import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationStatusType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType;

/**
* AD multi-domain test for AD 2102R2 hosted in Evolveum private cloud.
* This test has some strange configuration:
* * SPR is used instead of VLV for paging.
*
* @author Radovan Semancik
*/
@ContextConfiguration(locations = {"classpath:ctx-conntest-test-main.xml"})
@Listeners({ com.evolveum.midpoint.tools.testng.AlphabeticalMethodInterceptor.class })
@DirtiesContext(classMode = ClassMode.AFTER_CLASS)
public class TestAdLdapAd2012Strange extends TestAdLdapAd2012 {

@Override
protected File getResourceFile() {
return new File(getBaseDir(), "resource-ad2012-strange.xml");
}
}
Expand Up @@ -11,6 +11,7 @@

import java.io.File;

import com.evolveum.midpoint.schema.SearchResultMetadata;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.SchemaException;

Expand All @@ -24,6 +25,7 @@

/**
* OpenDJ, but without permissive modify, shortcut attributes, with manual matching rules, etc.
* Uses SPR instead of VLV for paging.
* Also has additional search filter.
*
* @author semancik
Expand Down Expand Up @@ -58,6 +60,11 @@ protected void assertStepSyncToken(String syncTaskOid, int step, long tsStart, l
// TODO: assert timistamp
}

@Override
protected void assertApproxNumberOfAllResults(SearchResultMetadata searchMetadata, Integer expectedNumber) {
// We are using SPR, it never returns this. Nothing to assert.
}

@Test
public void test818DeleteAccountHtm() throws Exception {
// Nothing to do. This won't work with modifytimestamp sync.
Expand Down

0 comments on commit 914eb7e

Please sign in to comment.