diff --git a/infra/prism/src/main/java/com/evolveum/midpoint/prism/marshaller/BeanUnmarshaller.java b/infra/prism/src/main/java/com/evolveum/midpoint/prism/marshaller/BeanUnmarshaller.java index 1e71703eb6b..a28272b733d 100644 --- a/infra/prism/src/main/java/com/evolveum/midpoint/prism/marshaller/BeanUnmarshaller.java +++ b/infra/prism/src/main/java/com/evolveum/midpoint/prism/marshaller/BeanUnmarshaller.java @@ -1218,6 +1218,10 @@ private T unmarshalEnumFromPrimitive(PrimitiveXNode prim, Class beanClass private ProtectedStringType unmarshalProtectedString(MapXNode map, Class beanClass, ParsingContext pc) throws SchemaException { ProtectedStringType protectedType = new ProtectedStringType(); XNodeProcessorUtil.parseProtectedType(protectedType, map, prismContext, pc); + if (protectedType.isEmpty()) { + // E.g. in case when the xmap is empty or if there are is just an expression + return null; + } return protectedType; } diff --git a/infra/schema/src/test/java/com/evolveum/midpoint/schema/TestConstants.java b/infra/schema/src/test/java/com/evolveum/midpoint/schema/TestConstants.java index 6e868877ef1..cb4d1e7a32e 100644 --- a/infra/schema/src/test/java/com/evolveum/midpoint/schema/TestConstants.java +++ b/infra/schema/src/test/java/com/evolveum/midpoint/schema/TestConstants.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013 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. diff --git a/infra/schema/src/test/java/com/evolveum/midpoint/schema/parser/TestParseResource.java b/infra/schema/src/test/java/com/evolveum/midpoint/schema/parser/TestParseResource.java index 653d2c04f59..eac8cd26cc7 100644 --- a/infra/schema/src/test/java/com/evolveum/midpoint/schema/parser/TestParseResource.java +++ b/infra/schema/src/test/java/com/evolveum/midpoint/schema/parser/TestParseResource.java @@ -276,6 +276,12 @@ private void assertResourceExpression(PrismObject resource, PrismC baseContextsProp.applyDefinition(new PrismPropertyDefinitionImpl<>(new QName("whatever","baseContexts"), DOMUtil.XSD_STRING, prismContext)); assertNotRaw(baseContextsProp); assertExpression(baseContextsProp, "script"); + + PrismProperty credentialsProp = findProp(ldapConfigPropItems, "credentials"); + assertRaw(credentialsProp); + credentialsProp.applyDefinition(new PrismPropertyDefinitionImpl<>(new QName("whatever","credentials"), ProtectedStringType.COMPLEX_TYPE, prismContext)); + assertNotRaw(credentialsProp); + assertExpression(credentialsProp, "const"); } PrismContainer schemaContainer = resource.findContainer(ResourceType.F_SCHEMA); @@ -370,28 +376,28 @@ private void doTestParseResourceExpressionRoundtrip(String serializeInto) throws } - private void assertRaw(PrismProperty prop) { + private void assertRaw(PrismProperty prop) { assertTrue("Prop "+prop+" no raw", prop.isRaw()); } - private void assertNotRaw(PrismProperty prop) { + private void assertNotRaw(PrismProperty prop) { assertFalse("Prop "+prop+" raw (unexpected)", prop.isRaw()); } - private PrismProperty findProp(List> items, String local) { + private PrismProperty findProp(List> items, String local) { for (Item item: items) { if (local.equals(item.getElementName().getLocalPart())) { - return (PrismProperty) item; + return (PrismProperty) item; } } fail("No item "+local); return null; // not reached } - private void assertExpression(PrismProperty prop, String evaluatorName) { + private void assertExpression(PrismProperty prop, String evaluatorName) { System.out.println("Prop:"); System.out.println(prop.debugDump(1)); - PrismPropertyValue pval = prop.getValue(); + PrismPropertyValue pval = prop.getValue(); ExpressionWrapper expressionWrapper = pval.getExpression(); assertNotNull("No expression wrapper in "+prop, expressionWrapper); Object expressionObj = expressionWrapper.getExpression(); diff --git a/infra/schema/src/test/resources/common/xml/no-ns/resource-expression.xml b/infra/schema/src/test/resources/common/xml/no-ns/resource-expression.xml index 52825fa79fe..7e141f8d725 100644 --- a/infra/schema/src/test/resources/common/xml/no-ns/resource-expression.xml +++ b/infra/schema/src/test/resources/common/xml/no-ns/resource-expression.xml @@ -49,7 +49,9 @@ cn=directory manager - secret + + password + uid ds-pwp-account-disabled diff --git a/infra/schema/src/test/resources/common/xml/ns/resource-expression.xml b/infra/schema/src/test/resources/common/xml/ns/resource-expression.xml index 839ecbbee2c..42e5a4b3402 100644 --- a/infra/schema/src/test/resources/common/xml/ns/resource-expression.xml +++ b/infra/schema/src/test/resources/common/xml/ns/resource-expression.xml @@ -68,7 +68,9 @@ cn=directory manager - secret + + password + uid ds-pwp-account-disabled diff --git a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java index 150450d867d..7d9eda9985f 100644 --- a/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java +++ b/model/model-intest/src/test/java/com/evolveum/midpoint/model/intest/AbstractConfiguredModelIntegrationTest.java @@ -352,9 +352,6 @@ public class AbstractConfiguredModelIntegrationTest extends AbstractModelIntegra public static final String ACCOUNT_HERMAN_DUMMY_OID = "22220000-2200-0000-0000-444400004444"; public static final String ACCOUNT_HERMAN_DUMMY_USERNAME = "ht"; - public static final String ACCOUNT_HERMAN_OPENDJ_FILENAME = COMMON_DIR + "/account-herman-opendj.xml"; - public static final String ACCOUNT_HERMAN_OPENDJ_OID = "22220000-2200-0000-0000-333300003333"; - public static final File ACCOUNT_SHADOW_GUYBRUSH_DUMMY_FILE = new File(COMMON_DIR, "account-shadow-guybrush-dummy.xml"); public static final String ACCOUNT_SHADOW_GUYBRUSH_OID = "22226666-2200-6666-6666-444400004444"; public static final String ACCOUNT_GUYBRUSH_DUMMY_USERNAME = "guybrush"; diff --git a/model/model-intest/src/test/resources/common/account-herman-opendj.xml b/model/model-intest/src/test/resources/common/account-herman-opendj.xml deleted file mode 100644 index 471fb88afac..00000000000 --- a/model/model-intest/src/test/resources/common/account-herman-opendj.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - ht - - ri:AccountObjectClass - default - 0 - - - uid=ht, ou=People, dc=example,dc=com - ht - Herman Toothrot - Herman - Toothrot - Monkey Island - - diff --git a/model/model-intest/src/test/resources/common/resource-opendj.xml b/model/model-intest/src/test/resources/common/resource-opendj.xml deleted file mode 100644 index 4810185ffe2..00000000000 --- a/model/model-intest/src/test/resources/common/resource-opendj.xml +++ /dev/null @@ -1,408 +0,0 @@ - - - - Localhost OpenDJ - - - - - c:connectorType - org.identityconnectors.ldap.LdapConnector - - - - - - - 10389 - localhost - dc=example,dc=com - uid=idm,ou=Administrators,dc=example,dc=com - - secret - - uid=idm,ou=Administrators,dc=example,dc=com - uid - true - ds-pwp-account-disabled - - - - - - - 2012-03-20T13:02:29.275+01:00 - 1798eed6def9f54c-3d4bce63faa79272 - - - - - - - - - - - icfs:uid - icfs:name - icfs:name - __GROUP__ - - - - - - - - - - - - - - - - - - - - - icfs:uid - icfs:name - icfs:name - icfs:name - __ACCOUNT__ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Default Account - true - ri:AccountObjectClass - - icfs:name - Distinguished Name - - - $user/name - - - - - - - - icfs:uid - Entry UUID - - - ri:cn - Common Name - - 1 - - - - $user/fullName - - - - - $user/fullName - - - - - ri:sn - Surname - - - $c:user/c:familyName - - - - - $c:user/c:familyName - - - - - ri:givenName - Given Name - - - givenName - - - - - - - - $c:user/c:givenName - - - - - ri:uid - Login Name - - weak - - name - - - - - - - - name - - - - - ri:description - - weak - - Created by IDM - - - - - - - declare namespace piracy="http://midpoint.evolveum.com/xml/ns/samples/piracy"; - $c:user/c:extension/piracy:tales - - - - - - ri:l - - - - my:defaultLocation - middle of nowhere - - - - - - - - 5 - - - - - - - - - - - - - 2012-03-20T13:02:29.275+01:00 - 1798eed6def9f54c-3d4bce63faa79272 - - - - - - - - - - - connector - - - - - - - ri:ds-pwp-account-disabled - - true - - - - - - - - true - - - - c:employeeNumber - - - - - - - c:employeeNumber - - - - - - - - linked - - - - deleted - - - - unlinked - - - - unmatched - - - - - - diff --git a/repo/repo-test-util/src/main/resources/test-config.xml b/repo/repo-test-util/src/main/resources/test-config.xml index fc1efdabd10..9d7a6f6e518 100644 --- a/repo/repo-test-util/src/main/resources/test-config.xml +++ b/repo/repo-test-util/src/main/resources/test-config.xml @@ -70,6 +70,8 @@ xUSEless rum Bla bla bla + dc=example,dc=com + secret \ No newline at end of file diff --git a/repo/system-init/src/main/java/com/evolveum/midpoint/init/StartupConfiguration.java b/repo/system-init/src/main/java/com/evolveum/midpoint/init/StartupConfiguration.java index 120ccc9a208..bd72b63d021 100644 --- a/repo/system-init/src/main/java/com/evolveum/midpoint/init/StartupConfiguration.java +++ b/repo/system-init/src/main/java/com/evolveum/midpoint/init/StartupConfiguration.java @@ -264,6 +264,7 @@ private void setupInitialLogging(File midpointHome) { private void createXmlConfiguration(DocumentBuilder documentBuilder, String filename) throws ConfigurationException { XMLConfiguration xmlConfig = new XMLConfiguration(); xmlConfig.setDocumentBuilder(documentBuilder); + xmlConfig.setDelimiterParsingDisabled(true); xmlConfig.setFileName(filename); xmlConfig.load(); config.addConfiguration(xmlConfig); diff --git a/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdap.java b/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdap.java index a243dde6247..50e691fb7a9 100644 --- a/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdap.java +++ b/testing/longtest/src/test/java/com/evolveum/midpoint/testing/longtest/TestLdap.java @@ -139,8 +139,8 @@ public class TestLdap extends AbstractModelIntegrationTest { private static final int NUM_INITIAL_USERS = 3; // Make it at least 1501 so it will go over the 3000 entries size limit - private static final int NUM_LDAP_ENTRIES = 1600; -// private static final int NUM_LDAP_ENTRIES = 100; +// private static final int NUM_LDAP_ENTRIES = 1600; + private static final int NUM_LDAP_ENTRIES = 100; private static final String LDAP_GROUP_PIRATES_DN = "cn=Pirates,ou=groups,dc=example,dc=com"; diff --git a/testing/longtest/src/test/resources/common/resource-opendj.xml b/testing/longtest/src/test/resources/common/resource-opendj.xml index 44e2e61fe44..dfe20102d9c 100644 --- a/testing/longtest/src/test/resources/common/resource-opendj.xml +++ b/testing/longtest/src/test/resources/common/resource-opendj.xml @@ -44,9 +44,23 @@ 10389 localhost - dc=example,dc=com - uid=idm,ou=Administrators,dc=example,dc=com - secret + + + baseDn + + + + + + + + + + passwordClear + + auto uid ds-pwp-account-disabled