diff --git a/gradle/java.gradle b/gradle/java.gradle index ef206e60..22828958 100644 --- a/gradle/java.gradle +++ b/gradle/java.gradle @@ -7,7 +7,6 @@ targetCompatibility = '1.8' ext.apacheDsVersion = '1.5.5' ext.springVersion = '4.3.27.RELEASE' ext.springDataVersion = '1.13.23.RELEASE' -ext.springDataSpring3Version = '1.10.2.RELEASE' ext.springBatchVersion = '2.0.4.RELEASE' ext.junitVersion = '4.12' ext.commonsIoVersion = '2.4' diff --git a/test/integration-tests-spring20/build.gradle b/test/integration-tests-spring20/build.gradle deleted file mode 100644 index 1159aee0..00000000 --- a/test/integration-tests-spring20/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -repositories { - mavenCentral() - maven { url "https://download.java.net/maven/2/" } -} -apply from: JAVA_SCRIPT - -ext.spring20Version = '2.0.8' - -dependencies { - testCompile (project(":spring-ldap-test")) { - exclude group: "org.springframework", module:"spring-core" - exclude group: "org.springframework", module:"spring-beans" - exclude group: "org.springframework", module:"spring-context" - exclude group: "org.springframework", module:"spring-test" - exclude group: "org.springframework", module:"spring-tx" - } - - testCompile "org.springframework:spring-mock:$spring20Version", - "org.springframework:spring-context:$spring20Version", - "org.springframework:spring-core:$spring20Version", - "org.springframework:spring-dao:$spring20Version", - "org.springframework:spring-beans:$spring20Version", - "org.slf4j:slf4j-log4j12:$slf4jVersion", - "org.assertj:assertj-core:$assertjVersion", - apachedsDependencies - -} diff --git a/test/integration-tests-spring20/src/test/java/org/springframework/ldap/itest20/LdapTemplateLookup20ITest.java b/test/integration-tests-spring20/src/test/java/org/springframework/ldap/itest20/LdapTemplateLookup20ITest.java deleted file mode 100644 index f60e6b80..00000000 --- a/test/integration-tests-spring20/src/test/java/org/springframework/ldap/itest20/LdapTemplateLookup20ITest.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2005-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ldap.itest20; - -import org.springframework.ldap.core.DirContextOperations; -import org.springframework.ldap.core.LdapTemplate; -import org.springframework.test.AbstractDependencyInjectionSpringContextTests; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests the lookup methods of LdapTemplate together with Spring 2.0. - * - * @author Mattias Hellborg Arthursson - */ -public class LdapTemplateLookup20ITest extends AbstractDependencyInjectionSpringContextTests { - - private LdapTemplate tested; - - public void setTested(LdapTemplate tested) { - this.tested = tested; - } - - @Override - protected String[] getConfigLocations() { - return new String[]{"/conf/ldapTemplateTestContext.xml"}; - } - - /** - * This method depends on a DirObjectFactory ( - * {@link org.springframework.ldap.core.support.DefaultDirObjectFactory}) - * being set in the ContextSource. - */ - public void testThatPlainLookupWorksWithSpring20() { - DirContextOperations result = tested.lookupContext("cn=Some Person2, ou=company1,c=Sweden"); - - assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person2"); - assertThat(result.getStringAttribute("sn")).isEqualTo("Person2"); - assertThat(result.getStringAttribute("description")).isEqualTo("Sweden, Company1, Some Person2"); - } -} diff --git a/test/integration-tests-spring20/src/test/resources/conf/commonTestContext.xml b/test/integration-tests-spring20/src/test/resources/conf/commonTestContext.xml deleted file mode 100644 index 6cc8f335..00000000 --- a/test/integration-tests-spring20/src/test/resources/conf/commonTestContext.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/test/integration-tests-spring20/src/test/resources/conf/ldap.properties b/test/integration-tests-spring20/src/test/resources/conf/ldap.properties deleted file mode 100644 index 8ae3f6be..00000000 --- a/test/integration-tests-spring20/src/test/resources/conf/ldap.properties +++ /dev/null @@ -1,4 +0,0 @@ -urls=ldap://127.0.0.1:1888 -userDn=uid=admin,ou=system -password=secret -base=dc=jayway,dc=se diff --git a/test/integration-tests-spring20/src/test/resources/conf/ldapTemplateTestContext.xml b/test/integration-tests-spring20/src/test/resources/conf/ldapTemplateTestContext.xml deleted file mode 100644 index aa77e3c2..00000000 --- a/test/integration-tests-spring20/src/test/resources/conf/ldapTemplateTestContext.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/test/integration-tests-spring20/src/test/resources/log4j.properties b/test/integration-tests-spring20/src/test/resources/log4j.properties deleted file mode 100644 index 43af6587..00000000 --- a/test/integration-tests-spring20/src/test/resources/log4j.properties +++ /dev/null @@ -1,12 +0,0 @@ -log4j.rootCategory=WARN, stdout -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout.ConversionPattern=%r [%t] %-5p\: %-15c{2} - %m%n -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -# Enable info on Spring LDAP -#log4j.logger.org.springframework.ldap=INFO - -log4j.logger.org.apache.directory.server.schema.registries.DefaultSyntaxRegistry=WARN -log4j.logger.org.apache.directory.server.core.schema.bootstrap=ERROR -log4j.logger.org.apache.directory.server.core.partition.impl.btree=ERROR -log4j.logger.org.apache.directory.shared.ldap.ldif=ERROR diff --git a/test/integration-tests-spring20/src/test/resources/setup_data.ldif b/test/integration-tests-spring20/src/test/resources/setup_data.ldif deleted file mode 100644 index 885a8ca4..00000000 --- a/test/integration-tests-spring20/src/test/resources/setup_data.ldif +++ /dev/null @@ -1,110 +0,0 @@ -dn: ou=groups,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: groups - -dn: cn=ROLE_USER,ou=groups,dc=jayway,dc=se -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 - -dn: cn=ROLE_ADMIN,ou=groups,dc=jayway,dc=se -objectclass: top -objectclass: groupOfUniqueNames -cn: ROLE_ADMIN -uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se - -dn: c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: country -c: Sweden -description: The country of Sweden - -dn: c=Norway,dc=jayway,dc=se -objectclass: top -objectclass: country -c: Norway -description: The country of Norway - -dn: ou=company1,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company1 -description: First company in Sweden - -dn: ou=company2,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company2 -description: Second company in Sweden - -dn: ou=company1,c=Norway,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company1 -description: First company in Norway - -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 - -dn: cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.person3 -userPassword: password -cn: Some Person3 -sn: Person3 -description: Sweden, Company1, Some Person3 -telephoneNumber: +46 555-123654 - -dn: cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.person4 -userPassword: password -cn: Some Person -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 -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.norwegian -userPassword: password -cn: Some Person -sn: Person -description: Norway, Company1, Some Person+Person -telephoneNumber: +45 555-654123 diff --git a/test/integration-tests-spring25/build.gradle b/test/integration-tests-spring25/build.gradle deleted file mode 100644 index dac70b82..00000000 --- a/test/integration-tests-spring25/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -repositories { - mavenCentral() - maven { url "https://download.java.net/maven/2/" } -} -apply from: JAVA_SCRIPT - -ext.spring25Version = '2.5.6.SEC03' - -dependencies { - testCompile (project(":spring-ldap-test")) { - exclude group: "org.springframework", module:"spring-core" - exclude group: "org.springframework", module:"spring-beans" - exclude group: "org.springframework", module:"spring-context" - exclude group: "org.springframework", module:"spring-test" - exclude group: "org.springframework", module:"spring-tx" - } - - testCompile ("org.springframework:spring-test:$spring25Version") { - exclude group: "junit", module:"junit" - } - - testCompile ("org.springframework.data:spring-data-commons:$springDataVersion") { - exclude group: "org.springframework", module:"spring-core" - exclude group: "org.springframework", module:"spring-beans" - } - - testCompile "org.springframework:spring-test:$spring25Version", - "org.springframework:spring-context:$spring25Version", - "org.springframework:spring-core:$spring25Version", - "org.springframework:spring-tx:$spring25Version", - "org.springframework:spring-beans:$spring25Version", - "junit:junit:$junitVersion", - "org.slf4j:slf4j-log4j12:$slf4jVersion", - "org.assertj:assertj-core:$assertjVersion", - apachedsDependencies - -} diff --git a/test/integration-tests-spring25/src/test/java/org/springframework/ldap/itest25/LdapTemplateLookup25ITest.java b/test/integration-tests-spring25/src/test/java/org/springframework/ldap/itest25/LdapTemplateLookup25ITest.java deleted file mode 100644 index 09879bad..00000000 --- a/test/integration-tests-spring25/src/test/java/org/springframework/ldap/itest25/LdapTemplateLookup25ITest.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2005-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ldap.itest25; - -import org.junit.Test; -import org.springframework.context.support.ClassPathXmlApplicationContext; -import org.springframework.ldap.core.DirContextOperations; -import org.springframework.ldap.core.LdapTemplate; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests the lookup methods of LdapTemplate together with Spring 2.5. - * - * @author Mattias Hellborg Arthursson - */ -public class LdapTemplateLookup25ITest { - /** - * This method depends on a DirObjectFactory ( - * {@link org.springframework.ldap.core.support.DefaultDirObjectFactory}) - * being set in the ContextSource. - */ - @Test - public void testThatPlainLookupWorksWithSpring25() { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/conf/ldapTemplateTestContext.xml"); - LdapTemplate tested = (LdapTemplate) ctx.getBean("ldapTemplate"); - - performTestAndShutdownContext(ctx, tested); - } - - @Test - public void testThatNamespaceConfigurationWorksWithSpring25() { - ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext("/conf/ldapTemplateNamespaceTestContext.xml"); - LdapTemplate tested = (LdapTemplate) ctx.getBean("ldapTemplate"); - - performTestAndShutdownContext(ctx, tested); - } - - private void performTestAndShutdownContext(ClassPathXmlApplicationContext ctx, LdapTemplate tested) { - try { - DirContextOperations result = tested.lookupContext("cn=Some Person2, ou=company1,c=Sweden"); - - assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person2"); - assertThat(result.getStringAttribute("sn")).isEqualTo("Person2"); - assertThat(result.getStringAttribute("description")).isEqualTo("Sweden, Company1, Some Person2"); - } finally { - ctx.close(); - } - } -} diff --git a/test/integration-tests-spring25/src/test/resources/conf/commonTestContext.xml b/test/integration-tests-spring25/src/test/resources/conf/commonTestContext.xml deleted file mode 100644 index 3bb88954..00000000 --- a/test/integration-tests-spring25/src/test/resources/conf/commonTestContext.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/test/integration-tests-spring25/src/test/resources/conf/ldap.properties b/test/integration-tests-spring25/src/test/resources/conf/ldap.properties deleted file mode 100644 index 8ae3f6be..00000000 --- a/test/integration-tests-spring25/src/test/resources/conf/ldap.properties +++ /dev/null @@ -1,4 +0,0 @@ -urls=ldap://127.0.0.1:1888 -userDn=uid=admin,ou=system -password=secret -base=dc=jayway,dc=se diff --git a/test/integration-tests-spring25/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml b/test/integration-tests-spring25/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml deleted file mode 100644 index ee5b9d4e..00000000 --- a/test/integration-tests-spring25/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/test/integration-tests-spring25/src/test/resources/conf/ldapTemplateTestContext.xml b/test/integration-tests-spring25/src/test/resources/conf/ldapTemplateTestContext.xml deleted file mode 100644 index 82f50135..00000000 --- a/test/integration-tests-spring25/src/test/resources/conf/ldapTemplateTestContext.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/test/integration-tests-spring25/src/test/resources/log4j.properties b/test/integration-tests-spring25/src/test/resources/log4j.properties deleted file mode 100644 index 43af6587..00000000 --- a/test/integration-tests-spring25/src/test/resources/log4j.properties +++ /dev/null @@ -1,12 +0,0 @@ -log4j.rootCategory=WARN, stdout -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout.ConversionPattern=%r [%t] %-5p\: %-15c{2} - %m%n -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -# Enable info on Spring LDAP -#log4j.logger.org.springframework.ldap=INFO - -log4j.logger.org.apache.directory.server.schema.registries.DefaultSyntaxRegistry=WARN -log4j.logger.org.apache.directory.server.core.schema.bootstrap=ERROR -log4j.logger.org.apache.directory.server.core.partition.impl.btree=ERROR -log4j.logger.org.apache.directory.shared.ldap.ldif=ERROR diff --git a/test/integration-tests-spring25/src/test/resources/setup_data.ldif b/test/integration-tests-spring25/src/test/resources/setup_data.ldif deleted file mode 100644 index 885a8ca4..00000000 --- a/test/integration-tests-spring25/src/test/resources/setup_data.ldif +++ /dev/null @@ -1,110 +0,0 @@ -dn: ou=groups,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: groups - -dn: cn=ROLE_USER,ou=groups,dc=jayway,dc=se -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 - -dn: cn=ROLE_ADMIN,ou=groups,dc=jayway,dc=se -objectclass: top -objectclass: groupOfUniqueNames -cn: ROLE_ADMIN -uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se - -dn: c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: country -c: Sweden -description: The country of Sweden - -dn: c=Norway,dc=jayway,dc=se -objectclass: top -objectclass: country -c: Norway -description: The country of Norway - -dn: ou=company1,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company1 -description: First company in Sweden - -dn: ou=company2,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company2 -description: Second company in Sweden - -dn: ou=company1,c=Norway,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company1 -description: First company in Norway - -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 - -dn: cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.person3 -userPassword: password -cn: Some Person3 -sn: Person3 -description: Sweden, Company1, Some Person3 -telephoneNumber: +46 555-123654 - -dn: cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.person4 -userPassword: password -cn: Some Person -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 -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.norwegian -userPassword: password -cn: Some Person -sn: Person -description: Norway, Company1, Some Person+Person -telephoneNumber: +45 555-654123 diff --git a/test/integration-tests-spring30/build.gradle b/test/integration-tests-spring30/build.gradle deleted file mode 100644 index d360bca7..00000000 --- a/test/integration-tests-spring30/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -repositories { - mavenCentral() - maven { url "https://download.java.net/maven/2/" } -} -apply from: JAVA_SCRIPT - -ext.spring30Version = '3.0.7.RELEASE' - -dependencies { - testCompile (project(":spring-ldap-test")) { - exclude group: "org.springframework", module:"spring-core" - exclude group: "org.springframework", module:"spring-beans" - exclude group: "org.springframework", module:"spring-context" - exclude group: "org.springframework", module:"spring-test" - exclude group: "org.springframework", module:"spring-tx" - } - - testCompile ("org.springframework:spring-test:$spring30Version") { - exclude group: "junit", module:"junit" - } - - testCompile "org.springframework:spring-test:$spring30Version", - "org.springframework:spring-context:$spring30Version", - "org.springframework:spring-core:$spring30Version", - "org.springframework:spring-tx:$spring30Version", - "org.springframework:spring-beans:$spring30Version", - "junit:junit:$junitVersion", - "org.slf4j:slf4j-log4j12:$slf4jVersion", - "org.assertj:assertj-core:$assertjVersion", - apachedsDependencies - - testCompile("org.springframework.data:spring-data-commons:$springDataVersion") { - exclude group: "org.springframework" - } -} diff --git a/test/integration-tests-spring30/src/test/java/org/springframework/ldap/itest30/LdapTemplateLookup30ITest.java b/test/integration-tests-spring30/src/test/java/org/springframework/ldap/itest30/LdapTemplateLookup30ITest.java deleted file mode 100644 index 63b44cc7..00000000 --- a/test/integration-tests-spring30/src/test/java/org/springframework/ldap/itest30/LdapTemplateLookup30ITest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2005-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ldap.itest30; - -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.ldap.core.DirContextOperations; -import org.springframework.ldap.core.LdapTemplate; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests the lookup methods of LdapTemplate together with Spring 3.0. - * - * @author Mattias Hellborg Arthursson - */ -@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"}) -@DirtiesContext -public class LdapTemplateLookup30ITest extends AbstractJUnit4SpringContextTests { - - @Autowired - private LdapTemplate tested; - - /** - * This method depends on a DirObjectFactory ( - * {@link org.springframework.ldap.core.support.DefaultDirObjectFactory}) - * being set in the ContextSource. - */ - @Test - public void testThatPlainLookupWorksWithSpring30() { - DirContextOperations result = tested.lookupContext("cn=Some Person2, ou=company1,c=Sweden"); - - assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person2"); - assertThat(result.getStringAttribute("sn")).isEqualTo("Person2"); - assertThat(result.getStringAttribute("description")).isEqualTo("Sweden, Company1, Some Person2"); - } -} diff --git a/test/integration-tests-spring30/src/test/java/org/springframework/ldap/itest30/LdapTemplateNamespaceLookup30ITest.java b/test/integration-tests-spring30/src/test/java/org/springframework/ldap/itest30/LdapTemplateNamespaceLookup30ITest.java deleted file mode 100644 index e46633a5..00000000 --- a/test/integration-tests-spring30/src/test/java/org/springframework/ldap/itest30/LdapTemplateNamespaceLookup30ITest.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2005-2016 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.ldap.itest30; - -import org.junit.Test; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.ldap.core.DirContextOperations; -import org.springframework.ldap.core.LdapTemplate; -import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.AbstractJUnit4SpringContextTests; - -import static org.assertj.core.api.Assertions.assertThat; - -/** - * Tests the lookup methods of LdapTemplate together with Spring 3.0. - * - * @author Mattias Hellborg Arthursson - */ -@ContextConfiguration(locations = {"/conf/ldapTemplateNamespaceTestContext.xml"}) -@DirtiesContext -public class LdapTemplateNamespaceLookup30ITest extends AbstractJUnit4SpringContextTests { - - @Autowired - private LdapTemplate tested; - - /** - * This method depends on a DirObjectFactory ( - * {@link org.springframework.ldap.core.support.DefaultDirObjectFactory}) - * being set in the ContextSource. - */ - @Test - public void testThatPlainLookupWorksWithSpring30() { - DirContextOperations result = tested.lookupContext("cn=Some Person2, ou=company1,c=Sweden"); - - assertThat(result.getStringAttribute("cn")).isEqualTo("Some Person2"); - assertThat(result.getStringAttribute("sn")).isEqualTo("Person2"); - assertThat(result.getStringAttribute("description")).isEqualTo("Sweden, Company1, Some Person2"); - } -} diff --git a/test/integration-tests-spring30/src/test/resources/conf/commonTestContext.xml b/test/integration-tests-spring30/src/test/resources/conf/commonTestContext.xml deleted file mode 100644 index 3bb88954..00000000 --- a/test/integration-tests-spring30/src/test/resources/conf/commonTestContext.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - diff --git a/test/integration-tests-spring30/src/test/resources/conf/ldap.properties b/test/integration-tests-spring30/src/test/resources/conf/ldap.properties deleted file mode 100644 index 8ae3f6be..00000000 --- a/test/integration-tests-spring30/src/test/resources/conf/ldap.properties +++ /dev/null @@ -1,4 +0,0 @@ -urls=ldap://127.0.0.1:1888 -userDn=uid=admin,ou=system -password=secret -base=dc=jayway,dc=se diff --git a/test/integration-tests-spring30/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml b/test/integration-tests-spring30/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml deleted file mode 100644 index ee5b9d4e..00000000 --- a/test/integration-tests-spring30/src/test/resources/conf/ldapTemplateNamespaceTestContext.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/test/integration-tests-spring30/src/test/resources/conf/ldapTemplateTestContext.xml b/test/integration-tests-spring30/src/test/resources/conf/ldapTemplateTestContext.xml deleted file mode 100644 index 82f50135..00000000 --- a/test/integration-tests-spring30/src/test/resources/conf/ldapTemplateTestContext.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/test/integration-tests-spring30/src/test/resources/log4j.properties b/test/integration-tests-spring30/src/test/resources/log4j.properties deleted file mode 100644 index 43af6587..00000000 --- a/test/integration-tests-spring30/src/test/resources/log4j.properties +++ /dev/null @@ -1,12 +0,0 @@ -log4j.rootCategory=WARN, stdout -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.appender.stdout.layout.ConversionPattern=%r [%t] %-5p\: %-15c{2} - %m%n -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout - -# Enable info on Spring LDAP -#log4j.logger.org.springframework.ldap=INFO - -log4j.logger.org.apache.directory.server.schema.registries.DefaultSyntaxRegistry=WARN -log4j.logger.org.apache.directory.server.core.schema.bootstrap=ERROR -log4j.logger.org.apache.directory.server.core.partition.impl.btree=ERROR -log4j.logger.org.apache.directory.shared.ldap.ldif=ERROR diff --git a/test/integration-tests-spring30/src/test/resources/setup_data.ldif b/test/integration-tests-spring30/src/test/resources/setup_data.ldif deleted file mode 100644 index 885a8ca4..00000000 --- a/test/integration-tests-spring30/src/test/resources/setup_data.ldif +++ /dev/null @@ -1,110 +0,0 @@ -dn: ou=groups,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: groups - -dn: cn=ROLE_USER,ou=groups,dc=jayway,dc=se -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 - -dn: cn=ROLE_ADMIN,ou=groups,dc=jayway,dc=se -objectclass: top -objectclass: groupOfUniqueNames -cn: ROLE_ADMIN -uniqueMember: cn=Some Person2,ou=company1,c=Sweden,dc=jayway,dc=se - -dn: c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: country -c: Sweden -description: The country of Sweden - -dn: c=Norway,dc=jayway,dc=se -objectclass: top -objectclass: country -c: Norway -description: The country of Norway - -dn: ou=company1,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company1 -description: First company in Sweden - -dn: ou=company2,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company2 -description: Second company in Sweden - -dn: ou=company1,c=Norway,dc=jayway,dc=se -objectclass: top -objectclass: organizationalUnit -ou: company1 -description: First company in Norway - -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 - -dn: cn=Some Person3,ou=company1,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.person3 -userPassword: password -cn: Some Person3 -sn: Person3 -description: Sweden, Company1, Some Person3 -telephoneNumber: +46 555-123654 - -dn: cn=Some Person,ou=company2,c=Sweden,dc=jayway,dc=se -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.person4 -userPassword: password -cn: Some Person -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 -objectclass: top -objectclass: person -objectclass: organizationalPerson -objectclass: inetOrgPerson -uid: some.norwegian -userPassword: password -cn: Some Person -sn: Person -description: Norway, Company1, Some Person+Person -telephoneNumber: +45 555-654123