directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From szoer...@apache.org
Subject svn commit: r552214 - /directory/sandbox/szoerner/groovyldap/src/main/groovy/demoCompare.groovy
Date Sat, 30 Jun 2007 21:22:12 GMT
Author: szoerner
Date: Sat Jun 30 14:22:11 2007
New Revision: 552214

URL: http://svn.apache.org/viewvc?view=rev&rev=552214
Log:
A more complete example for compare

Modified:
    directory/sandbox/szoerner/groovyldap/src/main/groovy/demoCompare.groovy

Modified: directory/sandbox/szoerner/groovyldap/src/main/groovy/demoCompare.groovy
URL: http://svn.apache.org/viewvc/directory/sandbox/szoerner/groovyldap/src/main/groovy/demoCompare.groovy?view=diff&rev=552214&r1=552213&r2=552214
==============================================================================
--- directory/sandbox/szoerner/groovyldap/src/main/groovy/demoCompare.groovy (original)
+++ directory/sandbox/szoerner/groovyldap/src/main/groovy/demoCompare.groovy Sat Jun 30 14:22:11
2007
@@ -2,7 +2,23 @@
 
 ldap = LDAP.newInstance('ldap://zanzibar:10389', 'uid=admin,ou=system' ,'secret')
 
+assert ! ldap.exists('cn=Heather Nova,dc=example,dc=com')
+
+// define an entry for compare ops
+attrs = [
+  objectclass: ['top', 'person'],              
+  sn: 'Nova',
+  cn: 'Heather Nova',
+  userPassword: 'secret'
+]
+ldap.add('cn=Heather Nova,dc=example,dc=com', attrs)
+
+assert ldap.exists('cn=Heather Nova,dc=example,dc=com')
+
+assert ldap.compare('cn=Heather Nova,dc=example,dc=com', [cn: 'Heather Nova'] )
 assert ldap.compare('cn=Heather Nova,dc=example,dc=com', [cn: 'HEATHER NOVA'] )
 
+assert ldap.compare('cn=Heather Nova,dc=example,dc=com', [userPassword: 'secret'] )
+assert ! ldap.compare('cn=Heather Nova,dc=example,dc=com', [userPassword: 'SECRET'] )
 
-println ldap.compare('cn=Heather Nova,dc=example,dc=com', [sn: '***'] )
\ No newline at end of file
+ldap.delete('cn=Heather Nova,dc=example,dc=com')
\ No newline at end of file



Mime
View raw message