Made sure integration tests for article sample automatically start in-process LDAP server.

DirContextAdapter#setDn() now throws IllegalStateException if setDn is called on an 
instance in update mode (this was previously silently ignored)
Fixed problem in LdapTreeBuilder caused by the new behaviour of DN in DirContextAdapter
(i.e. that the actual DN instance of the DirContextAdapter is no longer returned by 
getDn()).
This commit is contained in:
Mattias Arthursson
2008-11-25 15:24:05 +00:00
parent 47f2360e34
commit bf2c3af0a2
6 changed files with 74 additions and 17 deletions

View File

@@ -8,11 +8,14 @@
<property name="location" value="classpath:/config/ldap.properties" />
</bean>
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource" >
<property name="urls" value="${urls}" />
<property name="userDn" value="${userDn}" />
<bean id="contextSource"
class="org.springframework.ldap.test.TestContextSourceFactoryBean">
<property name="defaultPartitionSuffix" value="dc=jayway,dc=se" />
<property name="defaultPartitionName" value="jayway" />
<property name="principal" value="${userDn}" />
<property name="password" value="${password}" />
<property name="base" value="${base}" />
<property name="ldifFile" value="/setup_data.ldif" />
<property name="port" value="3901" />
</bean>
<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate">
@@ -26,7 +29,7 @@
<bean id="traditionalPersonDao"
class="org.springframework.ldap.samples.article.dao.TraditionalPersonDaoImpl">
<property name="url" value="ldap://localhost:3900" />
<property name="url" value="ldap://localhost:3901" />
<property name="base" value="dc=jayway,dc=se" />
<property name="userDn" value="${userDn}" />
<property name="password" value="${password}" />

View File

@@ -0,0 +1,35 @@
dn: c=Sweden,dc=jayway,dc=se
objectclass: top
objectclass: country
c: Sweden
description: The country of Sweden
dn: ou=company1,c=Sweden,dc=jayway,dc=se
objectclass: top
objectclass: organizationalUnit
ou: company1
description: First company in Sweden
dn: cn=Some Person,ou=company1,c=Sweden,dc=jayway,dc=se
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
uid: some.person
userPassword: password
cn: Some Person
sn: Person
description: Sweden, Company1, Some Person
telephoneNumber: +46 555-123456
dn: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
uid: some.person2
userPassword: password
cn: Some Person2
sn: Person2
description: Sweden, Company1, Some Person2
telephoneNumber: +46 555-654321