LDAPCompareTestCase.java revision 378931eeabc8709b956de2da88403d571c4aac07
1N/A * The contents of this file are subject to the terms of the 1N/A * Common Development and Distribution License, Version 1.0 only 1N/A * (the "License"). You may not use this file except in compliance 1N/A * You can obtain a copy of the license at 1N/A * See the License for the specific language governing permissions 1N/A * and limitations under the License. 1N/A * When distributing Covered Code, include this CDDL HEADER in each 1N/A * file and include the License file at 1N/A * add the following below this CDDL HEADER, with the fields enclosed 1N/A * by brackets "[]" replaced with your own identifying information: 1N/A * Portions Copyright [yyyy] [name of copyright owner] 1N/A * Portions Copyright 2006-2007 Sun Microsystems, Inc. * A set of test cases for the LDAPCompare tool. // The path to a file containing an invalid bind password. // The path to a file containing a valid bind password. * Ensures that the Directory Server is running and performs other necessary * @throws Exception If an unexpected problem occurs. * Retrieves sets of invalid arguments that may not be used to initialize * @return Sets of invalid arguments that may not be used to initialize the "--assertionFilter",
"(invalidfilter)",
"-D",
"cn=Directory Manager",
"-D",
"cn=Directory Manager",
"-J",
"1.2.3.4:invalidcriticality",
"-D",
"cn=Directory Manager",
"-D",
"cn=Directory Manager",
"-D",
"cn=Directory Manager",
* Tests the LDAPCompare tool with sets of invalid arguments. * @param args The set of arguments to use for the LDAPCompare * @param invalidReason The reason the provided set of arguments is invalid. * Tests a simple LDAPv2 compare. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a simple LDAPv3 compare in which the assertion is true. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a simple LDAPv3 compare in which the assertion is false. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a simple compare using SSL with blind trust. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a simple compare using SSL with a trust store. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a simple compare using StartTLS with blind trust. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a simple compare using StartTLS with a trust store. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a simple LDAP compare over SSL using a trust store and SASL EXTERNAL * @throws Exception If an unexpected problem occurs. "dn: cn=Test User,o=test",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"ds-privilege-name: bypass-acl",
* Tests a simple LDAP compare over SSL using a trust store and SASL EXTERNAL * authentication when explicitly specifying a valid client certificate. * @throws Exception If an unexpected problem occurs. "dn: cn=Test User,o=test",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"ds-privilege-name: bypass-acl",
* Tests a simple LDAP compare over SSL using a trust store and SASL EXTERNAL * authentication when explicitly specifying an invalid client certificate. * @throws Exception If an unexpected problem occurs. "dn: cn=Test User,o=test",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"ds-privilege-name: bypass-acl",
* Tests a simple LDAP compare using StartTLS with a trust store and SASL * EXTERNAL authentication. * @throws Exception If an unexpected problem occurs. "dn: cn=Test User,o=test",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"ds-privilege-name: bypass-acl",
* Tests a simple compare operation using CRAM-MD5 authentication. * @throws Exception If an unexpected problem occurs. "dn: uid=test.user,o=test",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"ds-privilege-name: bypass-acl",
"userPassword: password",
"ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," +
"cn=Password Policies,cn=config");
"-o",
"authid=u:test.user",
* Tests a simple compare operation using DIGEST-MD5 authentication. * @throws Exception If an unexpected problem occurs. "dn: uid=test.user,o=test",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"ds-privilege-name: bypass-acl",
"userPassword: password",
"ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," +
"cn=Password Policies,cn=config");
"-o",
"authid=u:test.user",
"-o",
"authzid=u:test.user",
* Tests a simple compare operation using PLAIN authentication. * @throws Exception If an unexpected problem occurs. "dn: uid=test.user,o=test",
"objectClass: organizationalPerson",
"objectClass: inetOrgPerson",
"userPassword: password");
"-o",
"authid=dn:cn=Directory Manager",
* Tests a a comparison in which the assertion value is base64-encoded with a * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a a comparison in which the assertion value should be base64-encoded * but uses an incorrect encoding. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
"o::***invalidencoding***",
* Tests a a comparison in which the assertion value is contained in a file. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a a comparison in which the assertion value is contained in a file * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a a comparison using the LDAP assertion control in which the * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
"--assertionFilter",
"(o=test)",
* Tests a a comparison using the LDAP assertion control in which the * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
"--assertionFilter",
"(o=notAMatch)",
* Tests a a compare operation reading the DNs to compare from a file. Some * of the compares will succeed and others will not. * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests a a compare operation reading the DNs to compare from a file that * @throws Exception If an unexpectd problem occurs. "-D",
"cn=Directory Manager",
* Tests the LDAPCompare tool with the "--help" option.