diff --git a/core/src/main/java/org/springframework/ldap/transaction/compensating/manager/TransactionAwareContextSourceProxy.java b/core/src/main/java/org/springframework/ldap/transaction/compensating/manager/TransactionAwareContextSourceProxy.java index bdf10874..929a2af5 100644 --- a/core/src/main/java/org/springframework/ldap/transaction/compensating/manager/TransactionAwareContextSourceProxy.java +++ b/core/src/main/java/org/springframework/ldap/transaction/compensating/manager/TransactionAwareContextSourceProxy.java @@ -99,6 +99,6 @@ public class TransactionAwareContextSourceProxy } public DirContext getContext(String principal, String credentials) throws NamingException { - throw new UnsupportedOperationException("Not supported on a transacted ContextSource"); + return target.getContext(principal, credentials); } } diff --git a/test-support/src/main/java/org/springframework/ldap/test/EmbeddedLdapServer.java b/test-support/src/main/java/org/springframework/ldap/test/EmbeddedLdapServer.java index 276f3c3f..794d83ac 100644 --- a/test-support/src/main/java/org/springframework/ldap/test/EmbeddedLdapServer.java +++ b/test-support/src/main/java/org/springframework/ldap/test/EmbeddedLdapServer.java @@ -16,6 +16,7 @@ package org.springframework.ldap.test; +import org.apache.commons.io.FileUtils; import org.apache.directory.server.core.DefaultDirectoryService; import org.apache.directory.server.core.DirectoryService; import org.apache.directory.server.core.entry.ServerEntry; @@ -35,6 +36,7 @@ import java.io.File; public final class EmbeddedLdapServer { private final DirectoryService directoryService; private final LdapServer ldapServer; + private static File workingDirectory; private EmbeddedLdapServer(DirectoryService directoryService, LdapServer ldapServer) { @@ -44,11 +46,14 @@ public final class EmbeddedLdapServer { public static EmbeddedLdapServer newEmbeddedServer(String defaultPartitionName, String defaultPartitionSuffix, int port) throws Exception{ + workingDirectory = new File(System.getProperty("java.io.tmpdir") + "/apacheds-test1"); + FileUtils.deleteDirectory(workingDirectory); DefaultDirectoryService directoryService = new DefaultDirectoryService(); directoryService.setShutdownHookEnabled(true); directoryService.setAllowAnonymousAccess(true); - directoryService.setWorkingDirectory(new File(System.getProperty("java.io.tmpdir") + "/apacheds-test1")); + + directoryService.setWorkingDirectory(workingDirectory); directoryService.getChangeLog().setEnabled( false ); JdbmPartition partition = new JdbmPartition(); @@ -80,5 +85,7 @@ public final class EmbeddedLdapServer { public void shutdown() throws Exception { ldapServer.stop(); directoryService.shutdown(); + + FileUtils.deleteDirectory(workingDirectory); } } diff --git a/test-support/src/main/java/org/springframework/ldap/test/LdapTestUtils.java b/test-support/src/main/java/org/springframework/ldap/test/LdapTestUtils.java index f198bf60..adbcc8ff 100644 --- a/test-support/src/main/java/org/springframework/ldap/test/LdapTestUtils.java +++ b/test-support/src/main/java/org/springframework/ldap/test/LdapTestUtils.java @@ -229,6 +229,10 @@ public final class LdapTestUtils { } private static void loadLdif(DirContext context, Resource ldifFile) throws IOException { + loadLdif(context, LdapUtils.emptyLdapName(), ldifFile); + } + + private static void loadLdif(DirContext context, Name rootNode, Resource ldifFile) { try { LdapName baseDn = (LdapName) context.getEnvironment().get(DefaultDirObjectFactory.JNDI_ENV_BASE_PATH_KEY); @@ -243,9 +247,13 @@ public final class LdapTestUtils { if(baseDn != null) { dn = LdapUtils.removeFirst(dn, baseDn); } + + if(!rootNode.isEmpty()) { + dn = LdapUtils.prepend(dn, rootNode); + } context.bind(dn, null, record); } - } catch (NamingException e) { + } catch (Exception e) { throw new RuntimeException("Failed to populate LDIF", e); } } diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/AbstractLdapTemplateIntegrationTest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/AbstractLdapTemplateIntegrationTest.java index 344143c8..9247d951 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/AbstractLdapTemplateIntegrationTest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/AbstractLdapTemplateIntegrationTest.java @@ -19,6 +19,7 @@ package org.springframework.ldap.itest; import org.junit.Before; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.ClassPathResource; import org.springframework.core.io.Resource; import org.springframework.ldap.core.ContextSource; @@ -38,6 +39,12 @@ public abstract class AbstractLdapTemplateIntegrationTest extends AbstractJUnit4 @Qualifier("contextSource") protected ContextSource contextSource; + @Value("${base}") + protected String base; + + @Value("${testRoot}") + protected String testRoot; + @Before public void cleanAndSetup() throws NamingException, IOException { LdapTestUtils.cleanAndSetup(contextSource, getRoot(), getLdifFileResource()); diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateBindUnbindITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateBindUnbindITest.java index 4dca689c..1008f2c8 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateBindUnbindITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateBindUnbindITest.java @@ -64,7 +64,7 @@ public class LdapTemplateBindUnbindITest extends ctx.addAttributeValue("cn", "TEST"); ctx.addAttributeValue("objectclass", "top"); ctx.addAttributeValue("objectclass", "groupOfUniqueNames"); - ctx.addAttributeValue("uniqueMember", LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se")); + ctx.addAttributeValue("uniqueMember", LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base)); tested.bind(ctx); } diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateLookupITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateLookupITest.java index a39762f6..a971941c 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateLookupITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateLookupITest.java @@ -22,10 +22,6 @@ import org.springframework.ldap.core.AttributesMapper; import org.springframework.ldap.core.ContextMapper; import org.springframework.ldap.core.DirContextAdapter; import org.springframework.ldap.core.LdapTemplate; -import org.springframework.ldap.core.support.AbstractContextSource; -import org.springframework.ldap.itest.Person; -import org.springframework.ldap.itest.PersonAttributesMapper; -import org.springframework.ldap.itest.PersonContextMapper; import org.springframework.ldap.support.LdapUtils; import org.springframework.test.context.ContextConfiguration; @@ -72,7 +68,7 @@ public class LdapTemplateLookupITest extends AbstractLdapTemplateIntegrationTest DirContextAdapter result = (DirContextAdapter) tested.lookup(""); assertEquals("", result.getDn().toString()); - assertEquals("dc=jayway,dc=se", result.getNameInNamespace()); + assertEquals(base, result.getNameInNamespace()); } @Test @@ -214,7 +210,7 @@ public class LdapTemplateLookupITest extends AbstractLdapTemplateIntegrationTest LdapName expectedName = LdapUtils.newLdapName(expectedDn); assertEquals(expectedName, result.getDn()); - assertEquals("cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se", result.getNameInNamespace()); + assertEquals("cn=Some Person2,ou=company1,c=Sweden," + base, result.getNameInNamespace()); } @Test @@ -222,29 +218,6 @@ public class LdapTemplateLookupITest extends AbstractLdapTemplateIntegrationTest DirContextAdapter result = (DirContextAdapter) tested.lookup("cn=Some Person+sn=Person,ou=company1,c=Norway"); assertEquals("cn=Some Person+sn=Person,ou=company1,c=Norway", result.getDn().toString()); - assertEquals("cn=Some Person+sn=Person,ou=company1,c=Norway,dc=jayway,dc=se", result.getNameInNamespace()); - } - - /** - * Tests bind and lookup with Java objects where the ContextSource already - * has a DirObjectFactory configured. - */ - @Test - public void testBindJavaObject() throws Exception { - AbstractContextSource contextSource = (AbstractContextSource) tested.getContextSource(); - Class originalObjectFactory = contextSource.getDirObjectFactory(); - try { - contextSource.setDirObjectFactory(null); - contextSource.afterPropertiesSet(); - tested.bind("cn=myRandomInt", new Integer(54321), null); - Integer result = (Integer) tested.lookup("cn=myRandomInt"); - assertEquals(54321, result.intValue()); - } - finally { - // reset the DirObjectFactory so as not to disturb other tests - tested.unbind("cn=myRandomInt"); - contextSource.setDirObjectFactory(originalObjectFactory); - contextSource.afterPropertiesSet(); - } + assertEquals("cn=Some Person+sn=Person,ou=company1,c=Norway," + base, result.getNameInNamespace()); } } diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateModifyITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateModifyITest.java index 012c0643..0938ef2c 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateModifyITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateModifyITest.java @@ -23,7 +23,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.ldap.AttributeInUseException; import org.springframework.ldap.core.DirContextAdapter; import org.springframework.ldap.core.DirContextOperations; -import org.springframework.ldap.core.DistinguishedName; import org.springframework.ldap.core.LdapTemplate; import org.springframework.ldap.support.LdapUtils; import org.springframework.test.context.ContextConfiguration; @@ -161,43 +160,6 @@ public class LdapTemplateModifyITest extends AbstractLdapTemplateIntegrationTest } } - // LDAP-188 - @Test - public void testModifyAttributes_AddAttributeValueAsDistinguishedName() { - try { - // prepare test data - String dn = "cn=ROLE_USER,ou=groups"; - String lowerCasedName = "cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se"; - String upperCasedName = "CN=Some Person,OU=company1,C=Sweden,DC=jayway,DC=se"; - DirContextOperations ctx = tested.lookupContext(dn); - ctx.removeAttributeValue("uniqueMember", lowerCasedName); - tested.modifyAttributes(ctx); - - ctx = tested.lookupContext(dn); - ctx.addAttributeValue("uniqueMember", upperCasedName); - tested.modifyAttributes(ctx); - - // without this, the member added above will not be removed and the test fails - System.setProperty(DistinguishedName.KEY_CASE_FOLD_PROPERTY, DistinguishedName.KEY_CASE_FOLD_NONE); - - ctx = tested.lookupContext(dn); - ctx.removeAttributeValue("uniqueMember", new DistinguishedName(upperCasedName).toCompactString()); - tested.modifyAttributes(ctx); - - // verify - DirContextAdapter result = (DirContextAdapter) tested.lookup(dn); - String[] attributes = result.getStringAttributes("uniqueMember"); - assertEquals(4, attributes.length); - assertEquals("0", "cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se", attributes[0]); - assertEquals("1", "cn=Some Person,ou=company1,c=Norway,dc=jayway,dc=se", attributes[1]); - assertEquals("2", "cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se", attributes[2]); - assertEquals("3", "cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se", attributes[3]); - } - finally { - System.clearProperty(DistinguishedName.KEY_CASE_FOLD_PROPERTY); - } - } - /** * Test written originally to verify that duplicates are allowed on ordered * attributes, but had to be changed since Apache DS seems to disallow diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateNoBaseSuffixITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateNoBaseSuffixITest.java index 238e5c4e..80e80b95 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateNoBaseSuffixITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplateNoBaseSuffixITest.java @@ -48,7 +48,7 @@ public class LdapTemplateNoBaseSuffixITest extends AbstractLdapTemplateIntegrati @Override protected Name getRoot() { - return LdapUtils.newLdapName("dc=jayway,dc=se"); + return LdapUtils.newLdapName(base); } /** @@ -57,7 +57,7 @@ public class LdapTemplateNoBaseSuffixITest extends AbstractLdapTemplateIntegrati */ @Test public void testLookup_Plain() { - String expectedDn = "cn=Some Person2, ou=company1, c=Sweden, dc=jayway, dc=se"; + String expectedDn = "cn=Some Person2, ou=company1, c=Sweden," + base; DirContextAdapter result = (DirContextAdapter) tested.lookup(expectedDn); assertEquals("Some Person2", result.getStringAttribute("cn")); @@ -73,7 +73,7 @@ public class LdapTemplateNoBaseSuffixITest extends AbstractLdapTemplateIntegrati public void testSearch_Plain() { CountNameClassPairCallbackHandler handler = new CountNameClassPairCallbackHandler(); - tested.search("dc=jayway, dc=se", "(objectclass=person)", handler); + tested.search(base, "(objectclass=person)", handler); assertEquals(5, handler.getNoOfRows()); } @@ -83,18 +83,18 @@ public class LdapTemplateNoBaseSuffixITest extends AbstractLdapTemplateIntegrati adapter.setAttributeValues("objectclass", new String[] { "top", "person" }); adapter.setAttributeValue("cn", "Some Person4"); adapter.setAttributeValue("sn", "Person4"); - tested.bind("cn=Some Person4, ou=company1, c=Sweden, dc=jayway, dc=se", adapter, null); + tested.bind("cn=Some Person4, ou=company1, c=Sweden," + base, adapter, null); DirContextAdapter result = (DirContextAdapter) tested - .lookup("cn=Some Person4, ou=company1, c=Sweden, dc=jayway, dc=se"); + .lookup("cn=Some Person4, ou=company1, c=Sweden," + base); assertEquals("Some Person4", result.getStringAttribute("cn")); assertEquals("Person4", result.getStringAttribute("sn")); - assertEquals(LdapUtils.newLdapName("cn=Some Person4,ou=company1,c=Sweden,dc=jayway,dc=se"), result.getDn()); + assertEquals(LdapUtils.newLdapName("cn=Some Person4,ou=company1,c=Sweden," + base), result.getDn()); - tested.unbind("cn=Some Person4,ou=company1,c=Sweden,dc=jayway,dc=se"); + tested.unbind("cn=Some Person4,ou=company1,c=Sweden," + base); try { - tested.lookup("cn=Some Person4, ou=company1, c=Sweden, dc=jayway, dc=se"); + tested.lookup("cn=Some Person4, ou=company1, c=Sweden," + base); fail("NameNotFoundException expected"); } catch (NameNotFoundException expected) { diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplatePooledITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplatePooledITest.java index 5c01c6c4..cf2eedd2 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplatePooledITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/LdapTemplatePooledITest.java @@ -17,17 +17,15 @@ package org.springframework.ldap.itest; import org.junit.After; -import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.core.io.ClassPathResource; import org.springframework.ldap.core.ContextSource; import org.springframework.ldap.core.DirContextOperations; import org.springframework.ldap.core.LdapTemplate; -import org.springframework.ldap.pool.factory.PoolingContextSource; import org.springframework.ldap.support.LdapUtils; import org.springframework.ldap.test.LdapTestUtils; -import org.springframework.ldap.transaction.compensating.manager.TransactionAwareContextSourceProxy; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; @@ -36,10 +34,7 @@ import static junit.framework.Assert.assertTrue; import static junit.framework.Assert.fail; /** - * Tests the lookup methods of LdapTemplate. - * - * @author Mattias Hellborg Arthursson - * @author Ulrik Sandberg + * This test only works against in-process Apache DS server, regardless of configured profile. */ @ContextConfiguration(locations = {"/conf/ldapTemplatePooledTestContext.xml"}) public class LdapTemplatePooledITest extends AbstractJUnit4SpringContextTests { @@ -50,6 +45,9 @@ public class LdapTemplatePooledITest extends AbstractJUnit4SpringContextTests { @Autowired private ContextSource contextSource; + @Value("${base}") + protected String base; + @After public void cleanup() throws Exception { LdapTestUtils.shutdownEmbeddedServer(); @@ -62,7 +60,7 @@ public class LdapTemplatePooledITest extends AbstractJUnit4SpringContextTests { */ @Test public void verifyThatInvalidConnectionIsAutomaticallyPurged() throws Exception { - LdapTestUtils.startEmbeddedServer(1888, "dc=jayway,dc=se", "jayway"); + LdapTestUtils.startEmbeddedServer(1888, base, "jayway"); LdapTestUtils.cleanAndSetup(contextSource, LdapUtils.emptyLdapName(), new ClassPathResource("/setup_data.ldif")); DirContextOperations result = tested.lookupContext("cn=Some Person2, ou=company1,c=Sweden"); @@ -72,7 +70,7 @@ public class LdapTemplatePooledITest extends AbstractJUnit4SpringContextTests { // Shutdown server and kill all existing connections LdapTestUtils.shutdownEmbeddedServer(); - LdapTestUtils.startEmbeddedServer(1888, "dc=jayway,dc=se", "jayway"); + LdapTestUtils.startEmbeddedServer(1888, base, "jayway"); try { tested.lookup("cn=Some Person2, ou=company1,c=Sweden"); @@ -82,6 +80,7 @@ public class LdapTemplatePooledITest extends AbstractJUnit4SpringContextTests { assertTrue(true); } + LdapTestUtils.cleanAndSetup(contextSource, LdapUtils.emptyLdapName(), new ClassPathResource("/setup_data.ldif")); // But this should be OK, because the dirty connection should have been automatically purged. tested.lookup("cn=Some Person2, ou=company1,c=Sweden"); } diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/control/SupportedControlsITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/control/SupportedControlsITest.java index 0c7d2a13..9818c69b 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/control/SupportedControlsITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/control/SupportedControlsITest.java @@ -27,8 +27,9 @@ import org.springframework.test.context.ContextConfiguration; import javax.naming.Name; import java.util.Arrays; +import java.util.HashSet; -import static junit.framework.Assert.assertEquals; +import static junit.framework.Assert.assertTrue; /** * Provides tests that verify that the server supports certain controls. @@ -45,7 +46,7 @@ public class SupportedControlsITest extends AbstractLdapTemplateIntegrationTest @Override protected Name getRoot() { - return LdapUtils.newLdapName("dc=jayway,dc=se"); + return LdapUtils.newLdapName(base); } @Test @@ -64,9 +65,11 @@ public class SupportedControlsITest extends AbstractLdapTemplateIntegrationTest String[] controls = (String[]) tested.lookup("", new String[] { SUPPORTED_CONTROL }, mapper); System.out.println(Arrays.toString(controls)); - assertEquals("Persistent Search LDAPv3 control,", "2.16.840.1.113730.3.4.3", controls[0]); - assertEquals("Entry Change Notification LDAPv3 control,", "2.16.840.1.113730.3.4.7", controls[1]); - assertEquals("Subentries Control,", "1.3.6.1.4.1.4203.1.10.1", controls[2]); - assertEquals("Manage DSA IT LDAPv3 control,", "2.16.840.1.113730.3.4.2", controls[3]); + + HashSet controlsSet = new HashSet(Arrays.asList(controls)); + + assertTrue("Entry Change Notification LDAPv3 control,", controlsSet.contains("1.3.6.1.4.1.4203.1.10.1")); + assertTrue("Subentries Control,", controlsSet.contains("1.3.6.1.4.1.4203.1.10.1")); + assertTrue("Manage DSA IT LDAPv3 control,", controlsSet.contains("2.16.840.1.113730.3.4.2")); } } diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/BaseLdapPathBeanPostprocessorITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/BaseLdapPathBeanPostprocessorITest.java index 491b95e0..e69832ac 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/BaseLdapPathBeanPostprocessorITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/BaseLdapPathBeanPostprocessorITest.java @@ -43,10 +43,10 @@ public class BaseLdapPathBeanPostprocessorITest { DistinguishedName base = tested.getBase(); assertNotNull(base); - assertEquals(new DistinguishedName("dc=jayway,dc=se"), base); + assertEquals(new DistinguishedName("dc=261consulting,dc=com"), base); DummyBaseLdapNameAware otherTested = ctx.getBean(DummyBaseLdapNameAware.class); - assertEquals(LdapUtils.newLdapName("dc=jayway,dc=se"), otherTested.getBaseLdapPath()); + assertEquals(LdapUtils.newLdapName("dc=261consulting,dc=com"), otherTested.getBaseLdapPath()); } @Test @@ -69,7 +69,7 @@ public class BaseLdapPathBeanPostprocessorITest { DistinguishedName base = tested.getBase(); assertNotNull(base); - assertEquals(new DistinguishedName("cn=john doe,dc=jayway,dc=se"), base); + assertEquals(new DistinguishedName("cn=john doe,dc=261consulting,dc=com"), base); } @Test @@ -103,6 +103,6 @@ public class BaseLdapPathBeanPostprocessorITest { DistinguishedName base = tested.getBase(); assertNotNull(base); - assertEquals(new DistinguishedName("dc=jayway,dc=se"), base); + assertEquals(new DistinguishedName("dc=261consulting,dc=com"), base); } } diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/LdapContextSourceIntegrationTest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/LdapContextSourceIntegrationTest.java index 583d1a5b..21487fe7 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/LdapContextSourceIntegrationTest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/core/support/LdapContextSourceIntegrationTest.java @@ -18,6 +18,7 @@ package org.springframework.ldap.itest.core.support; import org.junit.Test; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.dao.IncorrectResultSizeDataAccessException; import org.springframework.ldap.core.ContextSource; import org.springframework.ldap.core.DirContextOperations; @@ -26,6 +27,7 @@ import org.springframework.ldap.core.simple.AbstractParameterizedContextMapper; import org.springframework.ldap.core.support.LdapContextSource; import org.springframework.ldap.filter.EqualsFilter; import org.springframework.ldap.itest.AbstractLdapTemplateIntegrationTest; +import org.springframework.ldap.repository.Query; import org.springframework.ldap.support.LdapUtils; import org.springframework.test.context.ContextConfiguration; @@ -50,6 +52,7 @@ import static junit.framework.Assert.fail; public class LdapContextSourceIntegrationTest extends AbstractLdapTemplateIntegrationTest { @Autowired + @Qualifier("contextSource") private ContextSource tested; @Autowired @@ -63,7 +66,7 @@ public class LdapContextSourceIntegrationTest extends AbstractLdapTemplateIntegr ctx = tested.getReadOnlyContext(); assertNotNull(ctx); Hashtable environment = ctx.getEnvironment(); - assertTrue(environment.containsKey(LdapContextSource.SUN_LDAP_POOLING_FLAG)); + assertFalse(environment.containsKey(LdapContextSource.SUN_LDAP_POOLING_FLAG)); assertTrue(environment.containsKey(Context.SECURITY_PRINCIPAL)); assertTrue(environment.containsKey(Context.SECURITY_CREDENTIALS)); } @@ -89,7 +92,7 @@ public class LdapContextSourceIntegrationTest extends AbstractLdapTemplateIntegr assertNotNull(ctx); // Double check to see that we are authenticated. Hashtable environment = ctx.getEnvironment(); - assertTrue(environment.containsKey(LdapContextSource.SUN_LDAP_POOLING_FLAG)); + assertFalse(environment.containsKey(LdapContextSource.SUN_LDAP_POOLING_FLAG)); assertTrue(environment.containsKey(Context.SECURITY_PRINCIPAL)); assertTrue(environment.containsKey(Context.SECURITY_CREDENTIALS)); } @@ -110,7 +113,7 @@ public class LdapContextSourceIntegrationTest extends AbstractLdapTemplateIntegr public void testGetContext() throws NamingException { DirContext ctx = null; try { - String expectedPrincipal = "cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se"; + String expectedPrincipal = "cn=Some Person,ou=company1,c=Sweden," + base; String expectedCredentials = "password"; ctx = tested.getContext(expectedPrincipal, expectedCredentials); assertNotNull(ctx); diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/odm/LdapTemplateOdmGroupManipulationITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/odm/LdapTemplateOdmGroupManipulationITest.java index a3c7e381..3a023e9b 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/odm/LdapTemplateOdmGroupManipulationITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/odm/LdapTemplateOdmGroupManipulationITest.java @@ -50,81 +50,81 @@ public class LdapTemplateOdmGroupManipulationITest extends AbstractLdapTemplateI assertEquals(5, group.getMembers().size()); Set members = group.getMembers(); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se"))); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se"))); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Norway,dc=jayway,dc=se"))); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se"))); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se"))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person2,ou=company1,c=Sweden," + base))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Norway," + base))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company2,c=Sweden," + base))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person3,ou=company1,c=Sweden," + base))); } @Test public void testRemoveMember() { Group group = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); - group.removeMember(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se")); + group.removeMember(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base)); tested.update(group); Group verification = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); Set members = verification.getMembers(); assertEquals(4, members.size()); - assertFalse(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se"))); + assertFalse(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base))); } @Test public void testRemoveMemberSyntacticallyEqual() { Group group = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); - group.removeMember(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden, DC=jayway,DC=se")); + group.removeMember(LdapUtils.newLdapName("cn=Some Person,OU=company1, C=Sweden," + base)); tested.update(group); Group verification = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); Set members = verification.getMembers(); assertEquals(4, members.size()); - assertFalse(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se"))); + assertFalse(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base))); } @Test public void testAddMember() { Group group = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); - group.addMember(LdapUtils.newLdapName("cn=Some Person+sn=Person,ou=company1,c=Norway,dc=jayway,dc=se")); + group.addMember(LdapUtils.newLdapName("cn=Some Person+sn=Person,ou=company1,c=Norway," + base)); tested.update(group); Group verification = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); Set members = verification.getMembers(); assertEquals(6, members.size()); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person+sn=Person,ou=company1,c=Norway,dc=jayway,dc=se"))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person+sn=Person,ou=company1,c=Norway," + base))); } @Test public void testAddMemberDuplicate() { Group group = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); - group.addMember(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se")); + group.addMember(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base)); tested.update(group); Group verification = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); Set members = verification.getMembers(); assertEquals(5, members.size()); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se"))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base))); } @Test public void testAddMemberSyntacticallyEqualDuplicate() { Group group = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); - group.addMember(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,DC=jayway,DC=se")); + group.addMember(LdapUtils.newLdapName("cn=Some Person,OU=company1 ,C=Sweden," + base)); tested.update(group); Group verification = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); Set members = verification.getMembers(); assertEquals(5, members.size()); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se"))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base))); } @Test @@ -132,8 +132,8 @@ public class LdapTemplateOdmGroupManipulationITest extends AbstractLdapTemplateI Group group = tested.findOne(query().where("cn").is("ROLE_USER"), Group.class); group.setMembers(new HashSet(){{ - add(LdapUtils.newLdapName("CN=Some Person,OU=company1, C=Sweden, DC=jayway,DC=se")); - add(LdapUtils.newLdapName("CN=Some Person2, OU=company1,C=Sweden,DC=jayway, DC=se")); + add(LdapUtils.newLdapName("CN=Some Person,OU=company1, C=Sweden, " + base)); + add(LdapUtils.newLdapName("CN=Some Person2, OU=company1,C=Sweden," + base)); }}); tested.update(group); @@ -142,7 +142,7 @@ public class LdapTemplateOdmGroupManipulationITest extends AbstractLdapTemplateI Set members = verification.getMembers(); assertEquals(2, members.size()); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se"))); - assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se"))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person,ou=company1,c=Sweden," + base))); + assertTrue(members.contains(LdapUtils.newLdapName("cn=Some Person2,ou=company1,c=Sweden," + base))); } } diff --git a/test/integration-tests/src/test/java/org/springframework/ldap/itest/repository/RepositoryScanITest.java b/test/integration-tests/src/test/java/org/springframework/ldap/itest/repository/RepositoryScanITest.java index 7c4a188f..bf71e5e9 100644 --- a/test/integration-tests/src/test/java/org/springframework/ldap/itest/repository/RepositoryScanITest.java +++ b/test/integration-tests/src/test/java/org/springframework/ldap/itest/repository/RepositoryScanITest.java @@ -70,7 +70,7 @@ public class RepositoryScanITest extends AbstractLdapTemplateIntegrationTest { @Test public void verifyThatFindOneWithNonexistingDnReturnsNull() { - Person person = tested.findOne(LdapUtils.newLdapName("dn=unknown")); + Person person = tested.findOne(LdapUtils.newLdapName("cn=unknown")); assertNull(person); } diff --git a/test/integration-tests/src/test/resources/conf/apacheDsContext.xml b/test/integration-tests/src/test/resources/conf/apacheDsContext.xml deleted file mode 100644 index 4502ace1..00000000 --- a/test/integration-tests/src/test/resources/conf/apacheDsContext.xml +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - simple - - - ${userDn} - - - ${password} - - - - - - - - - - - - - - - - - - - - - objectClass: top - objectClass: domain - objectClass: extensibleObject - dc: jayway - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorMultiContextSourceOneSpecTestContext.xml b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorMultiContextSourceOneSpecTestContext.xml index 2956be69..cf5d1941 100644 --- a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorMultiContextSourceOneSpecTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorMultiContextSourceOneSpecTestContext.xml @@ -1,13 +1,13 @@ - + @@ -17,7 +17,7 @@ - + @@ -31,8 +31,8 @@ - + class="org.springframework.ldap.itest.core.support.DummyBaseLdapPathAware" /> + diff --git a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorMultiContextSourceTestContext.xml b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorMultiContextSourceTestContext.xml index 92a89960..55a26b3c 100644 --- a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorMultiContextSourceTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorMultiContextSourceTestContext.xml @@ -1,13 +1,13 @@ - + @@ -17,7 +17,7 @@ - + @@ -31,8 +31,8 @@ - + class="org.springframework.ldap.itest.core.support.DummyBaseLdapPathAware" /> + diff --git a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorPropertyOverrideTestContext.xml b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorPropertyOverrideTestContext.xml index 0d3e4eeb..06f40eca 100644 --- a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorPropertyOverrideTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorPropertyOverrideTestContext.xml @@ -1,13 +1,13 @@ - + @@ -21,8 +21,8 @@ - + class="org.springframework.ldap.itest.core.support.DummyBaseLdapPathAware" /> + diff --git a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorTestContext.xml b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorTestContext.xml index 545594e7..d0bb98b9 100644 --- a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorTestContext.xml @@ -7,7 +7,7 @@ - + diff --git a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorTransactionTestContext.xml b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorTransactionTestContext.xml index bbced46a..ef58ce58 100644 --- a/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorTransactionTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/baseLdapPathPostProcessorTransactionTestContext.xml @@ -1,13 +1,13 @@ - + @@ -26,8 +26,8 @@ - + class="org.springframework.ldap.itest.core.support.DummyBaseLdapPathAware" /> + diff --git a/test/integration-tests/src/test/resources/conf/commonContextSourceConfig.xml b/test/integration-tests/src/test/resources/conf/commonContextSourceConfig.xml new file mode 100644 index 00000000..09349d70 --- /dev/null +++ b/test/integration-tests/src/test/resources/conf/commonContextSourceConfig.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/integration-tests/src/test/resources/conf/commonNoNamespaceContextSourceConfig.xml b/test/integration-tests/src/test/resources/conf/commonNoNamespaceContextSourceConfig.xml new file mode 100644 index 00000000..6953bf29 --- /dev/null +++ b/test/integration-tests/src/test/resources/conf/commonNoNamespaceContextSourceConfig.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/integration-tests/src/test/resources/conf/commonTestContext.xml b/test/integration-tests/src/test/resources/conf/commonTestContext.xml index a71c074e..c49dc6b0 100644 --- a/test/integration-tests/src/test/resources/conf/commonTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/commonTestContext.xml @@ -1,16 +1,14 @@ - + - - - + diff --git a/test/integration-tests/src/test/resources/conf/ldap-247-testContext.xml b/test/integration-tests/src/test/resources/conf/ldap-247-testContext.xml index 52afb55c..229718bc 100644 --- a/test/integration-tests/src/test/resources/conf/ldap-247-testContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldap-247-testContext.xml @@ -6,19 +6,9 @@ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.0.xsd"> + - - - - - - - - - - - + + http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - - - - - - - - - - + diff --git a/test/integration-tests/src/test/resources/conf/ldapAndHibernateTransactionTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapAndHibernateTransactionTestContext.xml index 02c3a9fc..3cbcb283 100755 --- a/test/integration-tests/src/test/resources/conf/ldapAndHibernateTransactionTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapAndHibernateTransactionTestContext.xml @@ -2,20 +2,10 @@ + http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> - - - - - - - - - - + diff --git a/test/integration-tests/src/test/resources/conf/ldapAndJdbcTransactionNamespaceTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapAndJdbcTransactionNamespaceTestContext.xml index efd50198..27ed1cb5 100644 --- a/test/integration-tests/src/test/resources/conf/ldapAndJdbcTransactionNamespaceTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapAndJdbcTransactionNamespaceTestContext.xml @@ -21,20 +21,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - - - - - - - - - - + diff --git a/test/integration-tests/src/test/resources/conf/ldapAndJdbcTransactionTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapAndJdbcTransactionTestContext.xml index 232ba1e3..de3f8151 100644 --- a/test/integration-tests/src/test/resources/conf/ldapAndJdbcTransactionTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapAndJdbcTransactionTestContext.xml @@ -4,17 +4,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> - - - - - - - - - - + diff --git a/test/integration-tests/src/test/resources/conf/ldapContextSourceTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapContextSourceTestContext.xml index 2adc5219..53f10e49 100644 --- a/test/integration-tests/src/test/resources/conf/ldapContextSourceTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapContextSourceTestContext.xml @@ -1,8 +1,9 @@ - + diff --git a/test/integration-tests/src/test/resources/conf/ldapTemplateAcegiTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapTemplateAcegiTestContext.xml deleted file mode 100644 index aacdab93..00000000 --- a/test/integration-tests/src/test/resources/conf/ldapTemplateAcegiTestContext.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/integration-tests/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml index 7e1e4325..844bc9b2 100644 --- a/test/integration-tests/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml @@ -4,20 +4,7 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - - + - - - - - - - - diff --git a/test/integration-tests/src/test/resources/conf/ldapTemplateNamespaceTransactionTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapTemplateNamespaceTransactionTestContext.xml index 5b14e615..7e78f1b5 100644 --- a/test/integration-tests/src/test/resources/conf/ldapTemplateNamespaceTransactionTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapTemplateNamespaceTransactionTestContext.xml @@ -6,20 +6,7 @@ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - - - - - - - - - - + diff --git a/test/integration-tests/src/test/resources/conf/ldapTemplateNoBaseSuffixTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapTemplateNoBaseSuffixTestContext.xml index 0a96139e..1d9ade4c 100644 --- a/test/integration-tests/src/test/resources/conf/ldapTemplateNoBaseSuffixTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapTemplateNoBaseSuffixTestContext.xml @@ -1,27 +1,33 @@ + http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - - - - - - - - - - - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/integration-tests/src/test/resources/conf/ldapTemplatePooledTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapTemplatePooledTestContext.xml index ba7c1154..fa3c7b60 100644 --- a/test/integration-tests/src/test/resources/conf/ldapTemplatePooledTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapTemplatePooledTestContext.xml @@ -22,10 +22,10 @@ + username="uid=admin,ou=system" + base="dc=261consulting,dc=com"> + http://www.springframework.org/schema/beans/spring-beans-3.2.xsd"> + - - - - - - - - - - - - + + + diff --git a/test/integration-tests/src/test/resources/conf/ldapTemplateTransactionSubtreeTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapTemplateTransactionSubtreeTestContext.xml index 53bc61fb..190a367a 100644 --- a/test/integration-tests/src/test/resources/conf/ldapTemplateTransactionSubtreeTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapTemplateTransactionSubtreeTestContext.xml @@ -5,17 +5,7 @@ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> - - - - - - - - - - + diff --git a/test/integration-tests/src/test/resources/conf/ldapTemplateTransactionTestContext.xml b/test/integration-tests/src/test/resources/conf/ldapTemplateTransactionTestContext.xml index f2cbedeb..07ad5ac4 100644 --- a/test/integration-tests/src/test/resources/conf/ldapTemplateTransactionTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/ldapTemplateTransactionTestContext.xml @@ -5,17 +5,7 @@ http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd"> - - - - - - - - - - + diff --git a/test/integration-tests/src/test/resources/conf/repositoryScanAnnotationTestContext.xml b/test/integration-tests/src/test/resources/conf/repositoryScanAnnotationTestContext.xml index 79f0dfc0..0a2710e3 100644 --- a/test/integration-tests/src/test/resources/conf/repositoryScanAnnotationTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/repositoryScanAnnotationTestContext.xml @@ -5,22 +5,9 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> - - + - - - - - - - - diff --git a/test/integration-tests/src/test/resources/conf/repositoryScanTestContext.xml b/test/integration-tests/src/test/resources/conf/repositoryScanTestContext.xml index 8c904aba..b3aa3932 100644 --- a/test/integration-tests/src/test/resources/conf/repositoryScanTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/repositoryScanTestContext.xml @@ -4,21 +4,8 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - - + - - - - - - - - diff --git a/test/integration-tests/src/test/resources/conf/rootContextSourceTestContext.xml b/test/integration-tests/src/test/resources/conf/rootContextSourceTestContext.xml index f6252e8d..58c6523f 100644 --- a/test/integration-tests/src/test/resources/conf/rootContextSourceTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/rootContextSourceTestContext.xml @@ -1,25 +1,32 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ldap="http://www.springframework.org/schema/ldap" + xsi:schemaLocation="http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/ldap http://www.springframework.org/schema/ldap/spring-ldap.xsd"> - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/test/integration-tests/src/test/resources/conf/simpleLdapTemplateTestContext.xml b/test/integration-tests/src/test/resources/conf/simpleLdapTemplateTestContext.xml index 5e526b16..ea0669d8 100644 --- a/test/integration-tests/src/test/resources/conf/simpleLdapTemplateTestContext.xml +++ b/test/integration-tests/src/test/resources/conf/simpleLdapTemplateTestContext.xml @@ -4,23 +4,11 @@ xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> - - - - - - - - - + - diff --git a/test/integration-tests/src/test/resources/setup_data.ldif b/test/integration-tests/src/test/resources/setup_data.ldif index 885a8ca4..4199bef6 100644 --- a/test/integration-tests/src/test/resources/setup_data.ldif +++ b/test/integration-tests/src/test/resources/setup_data.ldif @@ -1,55 +1,55 @@ -dn: ou=groups,dc=jayway,dc=se +dn: ou=groups,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: groups -dn: cn=ROLE_USER,ou=groups,dc=jayway,dc=se +dn: cn=ROLE_USER,ou=groups,dc=261consulting,dc=com objectclass: top objectclass: groupOfUniqueNames cn: ROLE_USER -uniqueMember: cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se -uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se -uniqueMember: cn=Some Person,ou=company1,c=Norway,dc=jayway,dc=se -uniqueMember: cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se -uniqueMember: cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se +uniqueMember: cn=Some Person,ou=company1,c=Sweden,dc=261consulting,dc=com +uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=261consulting,dc=com +uniqueMember: cn=Some Person,ou=company1,c=Norway,dc=261consulting,dc=com +uniqueMember: cn=Some Person,ou=company2,c=Sweden,dc=261consulting,dc=com +uniqueMember: cn=Some Person3,ou=company1,c=Sweden,dc=261consulting,dc=com -dn: cn=ROLE_ADMIN,ou=groups,dc=jayway,dc=se +dn: cn=ROLE_ADMIN,ou=groups,dc=261consulting,dc=com objectclass: top objectclass: groupOfUniqueNames cn: ROLE_ADMIN -uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se +uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=261consulting,dc=com -dn: c=Sweden,dc=jayway,dc=se +dn: c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: country c: Sweden description: The country of Sweden -dn: c=Norway,dc=jayway,dc=se +dn: c=Norway,dc=261consulting,dc=com objectclass: top objectclass: country c: Norway description: The country of Norway -dn: ou=company1,c=Sweden,dc=jayway,dc=se +dn: ou=company1,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: company1 description: First company in Sweden -dn: ou=company2,c=Sweden,dc=jayway,dc=se +dn: ou=company2,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: company2 description: Second company in Sweden -dn: ou=company1,c=Norway,dc=jayway,dc=se +dn: ou=company1,c=Norway,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: company1 description: First company in Norway -dn: cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se +dn: cn=Some Person,ou=company1,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson @@ -61,7 +61,7 @@ sn: Person description: Sweden, Company1, Some Person telephoneNumber: +46 555-123456 -dn: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se +dn: cn=Some Person2,ou=company1,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson @@ -73,7 +73,7 @@ sn: Person2 description: Sweden, Company1, Some Person2 telephoneNumber: +46 555-654321 -dn: cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se +dn: cn=Some Person3,ou=company1,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson @@ -85,7 +85,7 @@ sn: Person3 description: Sweden, Company1, Some Person3 telephoneNumber: +46 555-123654 -dn: cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se +dn: cn=Some Person,ou=company2,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson @@ -97,7 +97,7 @@ sn: Person description: Sweden, Company2, Some Person telephoneNumber: +46 555-456321 -dn: cn=Some Person+sn=Person,ou=company1,c=Norway,dc=jayway,dc=se +dn: cn=Some Person+sn=Person,ou=company1,c=Norway,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson diff --git a/test/integration-tests/src/test/resources/setup_data_subtree.ldif b/test/integration-tests/src/test/resources/setup_data_subtree.ldif index e16b034a..8d3ccb52 100644 --- a/test/integration-tests/src/test/resources/setup_data_subtree.ldif +++ b/test/integration-tests/src/test/resources/setup_data_subtree.ldif @@ -1,61 +1,61 @@ -dn: ou=groups,dc=jayway,dc=se +dn: ou=groups,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: groups -dn: cn=ROLE_USER,ou=groups,dc=jayway,dc=se +dn: cn=ROLE_USER,ou=groups,dc=261consulting,dc=com objectclass: top objectclass: groupOfUniqueNames cn: ROLE_USER -uniqueMember: cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se -uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se -uniqueMember: cn=Some Person,ou=company1,c=Norway,dc=jayway,dc=se -uniqueMember: cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se -uniqueMember: cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se +uniqueMember: cn=Some Person,ou=company1,c=Sweden,dc=261consulting,dc=com +uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=261consulting,dc=com +uniqueMember: cn=Some Person,ou=company1,c=Norway,dc=261consulting,dc=com +uniqueMember: cn=Some Person,ou=company2,c=Sweden,dc=261consulting,dc=com +uniqueMember: cn=Some Person3,ou=company1,c=Sweden,dc=261consulting,dc=com -dn: cn=ROLE_ADMIN,ou=groups,dc=jayway,dc=se +dn: cn=ROLE_ADMIN,ou=groups,dc=261consulting,dc=com objectclass: top objectclass: groupOfUniqueNames cn: ROLE_ADMIN -uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se +uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=261consulting,dc=com -dn: ou=temp,dc=jayway,dc=se +dn: ou=temp,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: temp description: temp entry renaming node -dn: c=Sweden,dc=jayway,dc=se +dn: c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: country c: Sweden description: The country of Sweden -dn: c=Norway,dc=jayway,dc=se +dn: c=Norway,dc=261consulting,dc=com objectclass: top objectclass: country c: Norway description: The country of Norway -dn: ou=company1,c=Sweden,dc=jayway,dc=se +dn: ou=company1,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: company1 description: First company in Sweden -dn: ou=company2,c=Sweden,dc=jayway,dc=se +dn: ou=company2,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: company2 description: Second company in Sweden -dn: ou=company1,c=Norway,dc=jayway,dc=se +dn: ou=company1,c=Norway,dc=261consulting,dc=com objectclass: top objectclass: organizationalUnit ou: company1 description: First company in Norway -dn: cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se +dn: cn=Some Person,ou=company1,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson @@ -67,7 +67,7 @@ sn: Person description: Sweden, Company1, Some Person telephoneNumber: +46 555-123456 -dn: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se +dn: cn=Some Person2,ou=company1,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson @@ -79,7 +79,7 @@ sn: Person2 description: Sweden, Company1, Some Person2 telephoneNumber: +46 555-654321 -dn: cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se +dn: cn=Some Person3,ou=company1,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson @@ -91,7 +91,7 @@ sn: Person3 description: Sweden, Company1, Some Person3 telephoneNumber: +46 555-123654 -dn: cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se +dn: cn=Some Person,ou=company2,c=Sweden,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson @@ -103,7 +103,7 @@ sn: Person description: Sweden, Company2, Some Person telephoneNumber: +46 555-456321 -dn: cn=Some Person+sn=Person,ou=company1,c=Norway,dc=jayway,dc=se +dn: cn=Some Person+sn=Person,ou=company1,c=Norway,dc=261consulting,dc=com objectclass: top objectclass: person objectclass: organizationalPerson