Got rid of annoying javadoc warnings for "unmappable character".
Removed unused import. Change LdapServerManager to be BaseLdapPathAware.
This commit is contained in:
@@ -29,15 +29,14 @@ import javax.naming.NamingEnumeration;
|
||||
import javax.naming.NamingException;
|
||||
import javax.naming.directory.DirContext;
|
||||
|
||||
import org.springframework.ldap.core.ContextSource;
|
||||
import org.springframework.ldap.core.DistinguishedName;
|
||||
import org.springframework.ldap.core.support.DefaultDirObjectFactory;
|
||||
|
||||
import org.apache.directory.server.core.configuration.ShutdownConfiguration;
|
||||
import org.apache.directory.server.jndi.ServerContextFactory;
|
||||
import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.ldap.core.ContextSource;
|
||||
import org.springframework.ldap.core.DistinguishedName;
|
||||
import org.springframework.ldap.core.support.BaseLdapPathAware;
|
||||
|
||||
/**
|
||||
* Utility class to initialize the apache directory server. This means clearing
|
||||
@@ -45,11 +44,13 @@ import org.springframework.beans.factory.InitializingBean;
|
||||
*
|
||||
* @author Mattias Arthursson
|
||||
*/
|
||||
public class LdapServerManager implements InitializingBean, DisposableBean {
|
||||
public class LdapServerManager implements InitializingBean, DisposableBean, BaseLdapPathAware {
|
||||
|
||||
private ContextSource contextSource;
|
||||
|
||||
private String ldifFile;
|
||||
|
||||
private DistinguishedName baseLdapPath;
|
||||
|
||||
public void setContextSource(ContextSource contextSource) {
|
||||
this.contextSource = contextSource;
|
||||
@@ -59,6 +60,10 @@ public class LdapServerManager implements InitializingBean, DisposableBean {
|
||||
this.ldifFile = ldifFile;
|
||||
}
|
||||
|
||||
public void setBaseLdapPath(DistinguishedName baseLdapPath) {
|
||||
this.baseLdapPath = baseLdapPath;
|
||||
}
|
||||
|
||||
public void destroy() throws Exception {
|
||||
Properties env = new Properties();
|
||||
env.setProperty(Context.INITIAL_CONTEXT_FACTORY,
|
||||
@@ -81,11 +86,10 @@ public class LdapServerManager implements InitializingBean, DisposableBean {
|
||||
|
||||
// Different test cases have different base paths. This means that the
|
||||
// starting point will be different.
|
||||
if (ctx.getEnvironment().get(
|
||||
DefaultDirObjectFactory.JNDI_ENV_BASE_PATH_KEY) != null) {
|
||||
if (baseLdapPath.size() != 0) {
|
||||
startingPoint = DistinguishedName.EMPTY_PATH;
|
||||
} else {
|
||||
startingPoint = new DistinguishedName("dc=jayway,dc=se");
|
||||
startingPoint = new DistinguishedName(baseLdapPath);
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -53,9 +53,9 @@ public class CompanyOption extends AbstractChainedOption {
|
||||
*/
|
||||
protected void initChainedOption() {
|
||||
super.initChainedOption();
|
||||
Assert.notNull(companyDao, "Property <EFBFBD>companyDao<EFBFBD> must be set");
|
||||
Assert.notNull(countryProperty, "Property <EFBFBD>countryProperty<EFBFBD> must be set");
|
||||
Assert.notNull(getConverter(), "Property <EFBFBD>converter<EFBFBD> must be set");
|
||||
Assert.notNull(companyDao, "Property 'companyDao' must be set");
|
||||
Assert.notNull(countryProperty, "Property 'countryProperty' must be set");
|
||||
Assert.notNull(getConverter(), "Property 'converter' must be set");
|
||||
}
|
||||
|
||||
public void setCompanyDao(CompanyDao companyDao) {
|
||||
|
||||
@@ -50,8 +50,8 @@ public class CountryOption extends AbstractChainedOption {
|
||||
*/
|
||||
protected void initChainedOption() {
|
||||
super.initChainedOption();
|
||||
Assert.notNull(countryDao, "Property <EFBFBD>countryDao<EFBFBD> must be set");
|
||||
Assert.notNull(getConverter(), "Property <EFBFBD>converter<EFBFBD> must be set");
|
||||
Assert.notNull(countryDao, "Property 'countryDao' must be set");
|
||||
Assert.notNull(getConverter(), "Property 'converter' must be set");
|
||||
}
|
||||
|
||||
public void setCountryDao(CountryDao countryDao) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import java.util.List;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import org.easymock.MockControl;
|
||||
import org.springframework.ldap.samples.person.dao.GroupDao;
|
||||
import org.springframework.ldap.samples.person.dao.PersonDao;
|
||||
import org.springframework.ldap.samples.person.domain.Person;
|
||||
import org.springframework.ldap.samples.person.domain.SearchCriteria;
|
||||
|
||||
Reference in New Issue
Block a user