LDAP-168, LDAP-244: Added warning when using the default TempEntryRenamingStrategy.

Fixed failing test.
This commit is contained in:
Mattias Hellborg Arthursson
2013-08-12 09:03:42 +02:00
parent d08192d8aa
commit 45fcf782cf
6 changed files with 34 additions and 19 deletions

View File

@@ -19,6 +19,7 @@ import org.junit.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.ldap.core.ContextSource;
import org.springframework.ldap.core.DistinguishedName;
import org.springframework.ldap.test.LdapTestUtils;
@@ -28,7 +29,6 @@ import javax.naming.NamingException;
import java.io.IOException;
public abstract class AbstractLdapTemplateIntegrationTest extends AbstractJUnit4SpringContextTests {
private static final ClassPathResource LDIF_FILE_RESOURCE = new ClassPathResource("/setup_data.ldif");
@Autowired
@Qualifier("contextSource")
@@ -36,13 +36,11 @@ public abstract class AbstractLdapTemplateIntegrationTest extends AbstractJUnit4
@Before
public void cleanAndSetup() throws NamingException, IOException {
if (cleanBefore()) {
LdapTestUtils.cleanAndSetup(contextSource, getRoot(), LDIF_FILE_RESOURCE);
}
LdapTestUtils.cleanAndSetup(contextSource, getRoot(), getLdifFileResource());
}
protected boolean cleanBefore() {
return true;
protected Resource getLdifFileResource() {
return new ClassPathResource("/setup_data.ldif");
}
protected DistinguishedName getRoot() {

View File

@@ -15,12 +15,12 @@
*/
package org.springframework.ldap.transaction.compensating.manager;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.Before;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.ldap.AbstractLdapTemplateIntegrationTest;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.LdapTemplate;
@@ -41,8 +41,6 @@ import static junit.framework.Assert.fail;
@ContextConfiguration(locations = { "/conf/ldapTemplateTransactionSubtreeTestContext.xml" })
public class ContextSourceTransactionManagerSubtreeIntegrationTest extends AbstractLdapTemplateIntegrationTest {
private static Log log = LogFactory.getLog(ContextSourceTransactionManagerSubtreeIntegrationTest.class);
@Autowired
@Qualifier("dummyDao")
private DummyDao dummyDao;
@@ -57,9 +55,8 @@ public class ContextSourceTransactionManagerSubtreeIntegrationTest extends Abstr
}
}
@Override
protected boolean cleanBefore() {
return false;
protected Resource getLdifFileResource() {
return new ClassPathResource("/setup_data_subtree.ldif");
}
@Test