IN PROGRESS - issue LDAP-4: Translate LDAP error codes

http://opensource.atlassian.com/projects/spring/browse/LDAP-4
This commit is contained in:
Ulrik Sandberg
2007-01-12 16:20:49 +00:00
parent 01faa7e3b5
commit b30e4ef5c6
2 changed files with 11 additions and 11 deletions

View File

@@ -6,9 +6,9 @@ import javax.naming.directory.Attributes;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.ldap.LdapServerManager;
import org.springframework.ldap.NameNotFoundException;
import org.springframework.ldap.core.AttributesMapper;
import org.springframework.ldap.core.LdapTemplate;
import org.springframework.ldap.support.EntryNotFoundException;
import org.springframework.test.AbstractDependencyInjectionSpringContextTests;
public class ContextSourceTransactionManagerIntegrationTest extends
@@ -60,8 +60,8 @@ public class ContextSourceTransactionManagerIntegrationTest extends
try {
ldapTemplate.lookup("cn=some testperson, ou=company1, c=Sweden");
fail("EntryNotFoundException expected");
} catch (EntryNotFoundException expected) {
fail("NameNotFoundException expected");
} catch (NameNotFoundException expected) {
assertTrue(true);
}
}
@@ -132,8 +132,8 @@ public class ContextSourceTransactionManagerIntegrationTest extends
// Verify that entry was not moved.
try {
ldapTemplate.lookup(newDn);
fail("EntryNotFoundException expected");
} catch (EntryNotFoundException expected) {
fail("NameNotFoundException expected");
} catch (NameNotFoundException expected) {
assertTrue(true);
}
@@ -246,8 +246,8 @@ public class ContextSourceTransactionManagerIntegrationTest extends
try {
// Verify result - check that the operation was not rolled back
ldapTemplate.lookup(dn);
fail("EntryNotFoundException expected");
} catch (EntryNotFoundException expected) {
fail("NameNotFoundException expected");
} catch (NameNotFoundException expected) {
assertTrue(true);
}

View File

@@ -24,8 +24,8 @@ import javax.naming.directory.DirContext;
import javax.naming.ldap.Control;
import javax.naming.ldap.LdapContext;
import org.springframework.ldap.control.CreateControlFailedException;
import org.springframework.ldap.core.DirContextProcessor;
import org.springframework.ldap.support.UncategorizedLdapException;
import org.springframework.util.ReflectionUtils;
import com.sun.jndi.ldap.ctl.SortControl;
@@ -132,8 +132,8 @@ public class VirtualListViewRequestControl implements DirContextProcessor {
try {
sortControl = new SortControl(new String[] { "cn" }, true);
} catch (IOException e) {
throw new UncategorizedLdapException("Couldn't create SortControl",
e);
throw new CreateControlFailedException(
"Couldn't create SortControl", e);
}
// Add the new Controls at the end of the array.
newControls[newControls.length - 2] = sortControl;
@@ -161,7 +161,7 @@ public class VirtualListViewRequestControl implements DirContextProcessor {
}
return virtualListViewControl;
} catch (IOException e) {
throw new UncategorizedLdapException(
throw new CreateControlFailedException(
"Error creating VirtualListViewControl", e);
}
}