From a225dc3776ab9fb70b0960fad314176011150766 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Fri, 11 Feb 2011 17:55:16 +0000 Subject: [PATCH] SEC-1677: Split out integration tests from LDAP test code. --- ldap/ldap.gradle | 39 ++++++++-- .../ldap/AbstractLdapIntegrationTests.java | 40 ++++++++++ .../ldap/ApacheDSServerIntegrationTests.java} | 77 +++++++------------ ...faultSpringSecurityContextSourceTests.java | 0 .../ldap/SpringSecurityLdapTemplateTests.java | 7 +- .../BindAuthenticatorTests.java | 3 +- .../PasswordComparisonAuthenticatorTests.java | 6 +- .../FilterBasedLdapUserSearchTests.java | 35 +++------ .../ldap/server/ApacheDSContainerTests.java | 0 .../DefaultLdapAuthoritiesPopulatorTests.java | 5 +- .../LdapUserDetailsManagerTests.java | 7 +- .../resources/logback-test.xml | 2 + .../resources/test-server.ldif | 0 13 files changed, 129 insertions(+), 92 deletions(-) create mode 100644 ldap/src/integration-test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java rename ldap/src/{test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java => integration-test/java/org/springframework/security/ldap/ApacheDSServerIntegrationTests.java} (58%) rename ldap/src/{test => integration-test}/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java (100%) rename ldap/src/{test => integration-test}/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java (98%) rename ldap/src/{test => integration-test}/java/org/springframework/security/ldap/authentication/BindAuthenticatorTests.java (99%) rename ldap/src/{test => integration-test}/java/org/springframework/security/ldap/authentication/PasswordComparisonAuthenticatorTests.java (98%) rename ldap/src/{test => integration-test}/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java (80%) rename ldap/src/{test => integration-test}/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java (100%) rename ldap/src/{test => integration-test}/java/org/springframework/security/ldap/userdetails/DefaultLdapAuthoritiesPopulatorTests.java (98%) rename ldap/src/{test => integration-test}/java/org/springframework/security/ldap/userdetails/LdapUserDetailsManagerTests.java (98%) rename ldap/src/{test => integration-test}/resources/logback-test.xml (85%) rename ldap/src/{test => integration-test}/resources/test-server.ldif (100%) diff --git a/ldap/ldap.gradle b/ldap/ldap.gradle index c452e2c0bb..ae16958bd9 100644 --- a/ldap/ldap.gradle +++ b/ldap/ldap.gradle @@ -1,11 +1,5 @@ // Ldap build file -test { - exclude('**/OpenLDAPIntegrationTestSuite.class') - maxParallelForks = 1 - jvmArgs "-DapacheDSWorkDir=${buildDir}/apacheDSWork" -} - apacheds_libs = [ "org.apache.directory.server:apacheds-core:$apacheDsVersion", "org.apache.directory.server:apacheds-core-entry:$apacheDsVersion", @@ -15,6 +9,15 @@ apacheds_libs = [ 'org.apache.directory.shared:shared-ldap:0.9.15' ] +configurations { + integrationTestCompile { + extendsFrom testCompile + } + integrationTestRuntime { + extendsFrom integrationTestCompile, testRuntime + } +} + dependencies { compile project(':spring-security-core'), "org.springframework:spring-beans:$springVersion", @@ -35,3 +38,27 @@ dependencies { } } +sourceSets { + integrationTest { + java.srcDir file('src/integration-test/java') + resources.srcDir file('src/integration-test/resources') + compileClasspath = sourceSets.main.classes + sourceSets.test.classes + configurations.integrationTestCompile + runtimeClasspath = classes + compileClasspath + configurations.integrationTestRuntime + } +} + +task integrationTest(type: Test, dependsOn: jar) { + testClassesDir = sourceSets.integrationTest.classesDir + classpath = sourceSets.integrationTest.runtimeClasspath + include('**/ApacheDSServerIntegrationTests.class') +// exclude('**/OpenLDAPIntegrationTestSuite.class') + maxParallelForks = 1 + systemProperties['apacheDSWorkDir'] = "${buildDir}/apacheDSWork" +} + +task(ldapServer, dependsOn: 'integrationTestClasses', type: JavaExec) { + classpath = sourceSets.integrationTest.runtimeClasspath + main = 'org.springframework.security.ldap.ApacheDSServerIntegrationTests' + systemProperties['apacheDSWorkDir'] = "${buildDir}/apacheDSWork" +} + diff --git a/ldap/src/integration-test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java new file mode 100644 index 0000000000..7f94198227 --- /dev/null +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java @@ -0,0 +1,40 @@ +/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited + * + * 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 + * + * http://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.security.ldap; + +import org.junit.*; +import org.springframework.ldap.core.support.BaseLdapPathContextSource; + +/** + * @author Luke Taylor + */ +public abstract class AbstractLdapIntegrationTests { + private static DefaultSpringSecurityContextSource contextSource; + + @BeforeClass + public static void createContextSource() throws Exception { + contextSource = new DefaultSpringSecurityContextSource("ldap://127.0.0.1:53389/dc=springframework,dc=org"); +// OpenLDAP configuration +// contextSource = new DefaultSpringSecurityContextSource("ldap://127.0.0.1:22389/dc=springsource,dc=com"); +// contextSource.setUserDn("cn=admin,dc=springsource,dc=com"); +// contextSource.setPassword("password"); + contextSource.afterPropertiesSet(); + } + + public BaseLdapPathContextSource getContextSource() { + return contextSource; + } + +} diff --git a/ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDSServerIntegrationTests.java similarity index 58% rename from ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDSServerIntegrationTests.java index 29732d99d8..55c8b642cf 100644 --- a/ldap/src/test/java/org/springframework/security/ldap/AbstractLdapIntegrationTests.java +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/ApacheDSServerIntegrationTests.java @@ -1,59 +1,40 @@ -/* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited - * - * 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 - * - * http://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.security.ldap; -import javax.naming.Binding; -import javax.naming.ContextNotEmptyException; -import javax.naming.Name; -import javax.naming.NameNotFoundException; -import javax.naming.NamingEnumeration; -import javax.naming.NamingException; -import javax.naming.directory.DirContext; - -import org.apache.directory.server.protocol.shared.store.LdifFileLoader; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.springframework.core.io.ClassPathResource; -import org.springframework.ldap.core.DistinguishedName; -import org.springframework.ldap.core.support.BaseLdapPathContextSource; +import org.junit.*; +import org.junit.runner.RunWith; +import org.junit.runners.Suite; +import org.springframework.security.ldap.authentication.BindAuthenticatorTests; +import org.springframework.security.ldap.authentication.PasswordComparisonAuthenticatorTests; +import org.springframework.security.ldap.search.FilterBasedLdapUserSearchTests; import org.springframework.security.ldap.server.ApacheDSContainer; +import org.springframework.security.ldap.userdetails.DefaultLdapAuthoritiesPopulatorTests; +import org.springframework.security.ldap.userdetails.LdapUserDetailsManagerTests; /** - * Based on class borrowed from Spring Ldap project. - * * @author Luke Taylor */ -public abstract class AbstractLdapIntegrationTests { -// private static InMemoryXmlApplicationContext appContext; +@RunWith(Suite.class) +@Suite.SuiteClasses( { + BindAuthenticatorTests.class, + PasswordComparisonAuthenticatorTests.class, + FilterBasedLdapUserSearchTests.class, + DefaultLdapAuthoritiesPopulatorTests.class, + LdapUserDetailsManagerTests.class, + DefaultSpringSecurityContextSourceTests.class, + SpringSecurityLdapTemplateTests.class +} +) +public final class ApacheDSServerIntegrationTests { private static ApacheDSContainer server; - private static DefaultSpringSecurityContextSource contextSource; - - protected AbstractLdapIntegrationTests() { - } @BeforeClass public static void startServer() throws Exception { - contextSource = new DefaultSpringSecurityContextSource("ldap://127.0.0.1:53389/dc=springframework,dc=org"); // OpenLDAP configuration // contextSource = new DefaultSpringSecurityContextSource("ldap://127.0.0.1:22389/dc=springsource,dc=com"); // contextSource.setUserDn("cn=admin,dc=springsource,dc=com"); // contextSource.setPassword("password"); - contextSource.afterPropertiesSet(); server = new ApacheDSContainer("dc=springframework,dc=org", "classpath:test-server.ldif"); + server.setPort(53389); server.afterPropertiesSet(); } @@ -64,11 +45,15 @@ public abstract class AbstractLdapIntegrationTests { } } - @Before - public void onSetUp() throws Exception { + /** + * Main class to allow server to be started from gradle script + */ + public static void main(String[] args) throws Exception { + ApacheDSContainer server = new ApacheDSContainer("dc=springframework,dc=org", "classpath:test-server.ldif"); + server.afterPropertiesSet(); } - +/* @After public final void reloadServerDataIfDirty() throws Exception { ClassPathResource ldifs = new ClassPathResource("test-server.ldif"); @@ -91,11 +76,6 @@ public abstract class AbstractLdapIntegrationTests { } } - public BaseLdapPathContextSource getContextSource() { - return contextSource; - } - - private void clearSubContexts(DirContext ctx, Name name) throws NamingException { NamingEnumeration enumeration = null; @@ -124,4 +104,5 @@ public abstract class AbstractLdapIntegrationTests { } } } + */ } diff --git a/ldap/src/test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java similarity index 100% rename from ldap/src/test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/DefaultSpringSecurityContextSourceTests.java diff --git a/ldap/src/test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java similarity index 98% rename from ldap/src/test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java index 07d602d6f2..e6d7521c87 100644 --- a/ldap/src/test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/SpringSecurityLdapTemplateTests.java @@ -25,7 +25,7 @@ import javax.naming.directory.DirContext; import javax.naming.directory.SearchControls; import javax.naming.directory.SearchResult; -import org.junit.Test; +import org.junit.*; import org.springframework.ldap.UncategorizedLdapException; import org.springframework.ldap.core.ContextExecutor; @@ -39,9 +39,8 @@ public class SpringSecurityLdapTemplateTests extends AbstractLdapIntegrationTest //~ Methods ======================================================================================================== - public void onSetUp() throws Exception { - super.onSetUp(); - + @Before + public void setUp() throws Exception { template = new SpringSecurityLdapTemplate(getContextSource()); } diff --git a/ldap/src/test/java/org/springframework/security/ldap/authentication/BindAuthenticatorTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/authentication/BindAuthenticatorTests.java similarity index 99% rename from ldap/src/test/java/org/springframework/security/ldap/authentication/BindAuthenticatorTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/authentication/BindAuthenticatorTests.java index 58956fe312..c58cf65597 100644 --- a/ldap/src/test/java/org/springframework/security/ldap/authentication/BindAuthenticatorTests.java +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/authentication/BindAuthenticatorTests.java @@ -40,7 +40,8 @@ public class BindAuthenticatorTests extends AbstractLdapIntegrationTests { //~ Methods ======================================================================================================== - public void onSetUp() { + @Before + public void setUp() { authenticator = new BindAuthenticator(getContextSource()); authenticator.setMessageSource(new SpringSecurityMessageSource()); bob = new UsernamePasswordAuthenticationToken("bob", "bobspassword"); diff --git a/ldap/src/test/java/org/springframework/security/ldap/authentication/PasswordComparisonAuthenticatorTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/authentication/PasswordComparisonAuthenticatorTests.java similarity index 98% rename from ldap/src/test/java/org/springframework/security/ldap/authentication/PasswordComparisonAuthenticatorTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/authentication/PasswordComparisonAuthenticatorTests.java index 25ad1543ff..654fb69697 100644 --- a/ldap/src/test/java/org/springframework/security/ldap/authentication/PasswordComparisonAuthenticatorTests.java +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/authentication/PasswordComparisonAuthenticatorTests.java @@ -16,6 +16,7 @@ package org.springframework.security.ldap.authentication; +import org.junit.*; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.encoding.LdapShaPasswordEncoder; @@ -29,7 +30,6 @@ import org.springframework.ldap.core.DirContextAdapter; import org.springframework.ldap.core.DistinguishedName; import static org.junit.Assert.*; -import org.junit.Test; /** * Tests for {@link PasswordComparisonAuthenticator}. @@ -45,8 +45,8 @@ public class PasswordComparisonAuthenticatorTests extends AbstractLdapIntegratio //~ Methods ======================================================================================================== - public void onSetUp() throws Exception { - super.onSetUp(); + @Before + public void setUp() throws Exception { authenticator = new PasswordComparisonAuthenticator(getContextSource()); authenticator.setPasswordEncoder(new PlaintextPasswordEncoder()); authenticator.setUserDnPatterns(new String[] {"uid={0},ou=people"}); diff --git a/ldap/src/test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java similarity index 80% rename from ldap/src/test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java index c5ecfcea9d..57e72e9b28 100644 --- a/ldap/src/test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/search/FilterBasedLdapUserSearchTests.java @@ -15,15 +15,14 @@ package org.springframework.security.ldap.search; -import org.springframework.security.core.userdetails.UsernameNotFoundException; -import org.springframework.security.ldap.AbstractLdapIntegrationTests; +import static org.junit.Assert.*; + +import org.junit.*; import org.springframework.dao.IncorrectResultSizeDataAccessException; import org.springframework.ldap.core.DirContextOperations; import org.springframework.ldap.core.DistinguishedName; -import org.springframework.ldap.core.support.BaseLdapPathContextSource; - -import static org.junit.Assert.assertEquals; -import org.junit.Test; +import org.springframework.security.core.userdetails.UsernameNotFoundException; +import org.springframework.security.ldap.AbstractLdapIntegrationTests; /** * Tests for FilterBasedLdapUserSearch. @@ -31,20 +30,10 @@ import org.junit.Test; * @author Luke Taylor */ public class FilterBasedLdapUserSearchTests extends AbstractLdapIntegrationTests { - //~ Instance fields ================================================================================================ - - private BaseLdapPathContextSource dirCtxFactory; - - //~ Methods ======================================================================================================== - - public void onSetUp() throws Exception { - super.onSetUp(); - dirCtxFactory = getContextSource(); - } @Test public void basicSearchSucceeds() { - FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(uid={0})", dirCtxFactory); + FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(uid={0})", getContextSource()); locator.setSearchSubtree(false); locator.setSearchTimeLimit(0); locator.setDerefLinkFlag(false); @@ -57,7 +46,7 @@ public class FilterBasedLdapUserSearchTests extends AbstractLdapIntegrationTests @Test public void searchForNameWithCommaSucceeds() { - FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(uid={0})", dirCtxFactory); + FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(uid={0})", getContextSource()); locator.setSearchSubtree(false); DirContextOperations jerry = locator.searchForUser("jerry"); @@ -70,7 +59,7 @@ public class FilterBasedLdapUserSearchTests extends AbstractLdapIntegrationTests @Test public void extraFilterPartToExcludeBob() throws Exception { FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", - "(&(cn=*)(!(|(uid={0})(uid=rod)(uid=jerry)(uid=slashguy))))", dirCtxFactory); + "(&(cn=*)(!(|(uid={0})(uid=rod)(uid=jerry)(uid=slashguy))))", getContextSource()); // Search for bob, get back ben... DirContextOperations ben = locator.searchForUser("bob"); @@ -79,20 +68,20 @@ public class FilterBasedLdapUserSearchTests extends AbstractLdapIntegrationTests @Test(expected=IncorrectResultSizeDataAccessException.class) public void searchFailsOnMultipleMatches() { - FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(cn=*)", dirCtxFactory); + FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(cn=*)", getContextSource()); locator.searchForUser("Ignored"); } @Test(expected=UsernameNotFoundException.class) public void searchForInvalidUserFails() { - FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(uid={0})", dirCtxFactory); + FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=people", "(uid={0})", getContextSource()); locator.searchForUser("Joe"); } @Test public void subTreeSearchSucceeds() { // Don't set the searchBase, so search from the root. - FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("", "(cn={0})", dirCtxFactory); + FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("", "(cn={0})", getContextSource()); locator.setSearchSubtree(true); DirContextOperations ben = locator.searchForUser("Ben Alex"); @@ -103,7 +92,7 @@ public class FilterBasedLdapUserSearchTests extends AbstractLdapIntegrationTests @Test public void searchWithDifferentSearchBaseIsSuccessful() throws Exception { - FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=otherpeople", "(cn={0})", dirCtxFactory); + FilterBasedLdapUserSearch locator = new FilterBasedLdapUserSearch("ou=otherpeople", "(cn={0})", getContextSource()); DirContextOperations joe = locator.searchForUser("Joe Smeth"); assertEquals("Joe Smeth", joe.getStringAttribute("cn")); } diff --git a/ldap/src/test/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java similarity index 100% rename from ldap/src/test/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/server/ApacheDSContainerTests.java diff --git a/ldap/src/test/java/org/springframework/security/ldap/userdetails/DefaultLdapAuthoritiesPopulatorTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/userdetails/DefaultLdapAuthoritiesPopulatorTests.java similarity index 98% rename from ldap/src/test/java/org/springframework/security/ldap/userdetails/DefaultLdapAuthoritiesPopulatorTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/userdetails/DefaultLdapAuthoritiesPopulatorTests.java index f592a15a1a..3c1c085b75 100644 --- a/ldap/src/test/java/org/springframework/security/ldap/userdetails/DefaultLdapAuthoritiesPopulatorTests.java +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/userdetails/DefaultLdapAuthoritiesPopulatorTests.java @@ -38,9 +38,8 @@ public class DefaultLdapAuthoritiesPopulatorTests extends AbstractLdapIntegratio private DefaultLdapAuthoritiesPopulator populator; //~ Methods ======================================================================================================== - public void onSetUp() throws Exception { - super.onSetUp(); - + @Before + public void setUp() throws Exception { populator = new DefaultLdapAuthoritiesPopulator(getContextSource(), "ou=groups"); populator.setIgnorePartialResultException(false); } diff --git a/ldap/src/test/java/org/springframework/security/ldap/userdetails/LdapUserDetailsManagerTests.java b/ldap/src/integration-test/java/org/springframework/security/ldap/userdetails/LdapUserDetailsManagerTests.java similarity index 98% rename from ldap/src/test/java/org/springframework/security/ldap/userdetails/LdapUserDetailsManagerTests.java rename to ldap/src/integration-test/java/org/springframework/security/ldap/userdetails/LdapUserDetailsManagerTests.java index 3093907290..719344b2f5 100644 --- a/ldap/src/test/java/org/springframework/security/ldap/userdetails/LdapUserDetailsManagerTests.java +++ b/ldap/src/integration-test/java/org/springframework/security/ldap/userdetails/LdapUserDetailsManagerTests.java @@ -21,8 +21,7 @@ import static org.junit.Assert.fail; import java.util.List; -import org.junit.After; -import org.junit.Test; +import org.junit.*; import org.springframework.ldap.core.DirContextAdapter; import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; @@ -47,8 +46,8 @@ public class LdapUserDetailsManagerTests extends AbstractLdapIntegrationTests { private LdapUserDetailsManager mgr; private SpringSecurityLdapTemplate template; - public void onSetUp() throws Exception { - super.onSetUp(); + @Before + public void setUp() throws Exception { mgr = new LdapUserDetailsManager(getContextSource()); template = new SpringSecurityLdapTemplate(getContextSource()); DirContextAdapter ctx = new DirContextAdapter(); diff --git a/ldap/src/test/resources/logback-test.xml b/ldap/src/integration-test/resources/logback-test.xml similarity index 85% rename from ldap/src/test/resources/logback-test.xml rename to ldap/src/integration-test/resources/logback-test.xml index b0b310fca9..60cd6fd4ee 100644 --- a/ldap/src/test/resources/logback-test.xml +++ b/ldap/src/integration-test/resources/logback-test.xml @@ -7,6 +7,8 @@ + + diff --git a/ldap/src/test/resources/test-server.ldif b/ldap/src/integration-test/resources/test-server.ldif similarity index 100% rename from ldap/src/test/resources/test-server.ldif rename to ldap/src/integration-test/resources/test-server.ldif