From def8a849a2b611403da5ce9b617eded0d3f92a69 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Sun, 30 Apr 2006 21:53:05 +0000 Subject: [PATCH] Added String-only 'compare' operation tests which now work with ApacheDS RC2 (unlike byte[] comparisons which are still broken). --- .../org/acegisecurity/ldap/LdapTemplateTests.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/test/java/org/acegisecurity/ldap/LdapTemplateTests.java b/core/src/test/java/org/acegisecurity/ldap/LdapTemplateTests.java index c3479a0a53..86aad012e6 100644 --- a/core/src/test/java/org/acegisecurity/ldap/LdapTemplateTests.java +++ b/core/src/test/java/org/acegisecurity/ldap/LdapTemplateTests.java @@ -32,12 +32,22 @@ public class LdapTemplateTests extends AbstractLdapServerTestCase { public void testCompareOfCorrectValueSucceeds() { LdapTemplate template = new LdapTemplate(getInitialCtxFactory()); + assertTrue(template.compare("uid=bob,ou=people", "uid", "bob")); + } + + public void testCompareOfWrongValueFails() { + LdapTemplate template = new LdapTemplate(getInitialCtxFactory()); + assertFalse(template.compare("uid=bob,ou=people", "uid", "wrongvalue")); + } + + public void testCompareOfCorrectByteValueSucceeds() { + LdapTemplate template = new LdapTemplate(getInitialCtxFactory()); // Doesn't work with embedded server due to bugs in apacheds // assertTrue(template.compare("uid=bob,ou=people", "userPassword", LdapUtils.getUtf8Bytes("bobspassword"))); } - public void testCompareOfWrongValueFails() { + public void testCompareOfWrongByteValueFails() { LdapTemplate template = new LdapTemplate(getInitialCtxFactory()); // Doesn't work with embedded server due to bugs in apacheds