760N/A * The contents of this file are subject to the terms of the 760N/A * Common Development and Distribution License, Version 1.0 only 760N/A * (the "License"). You may not use this file except in compliance 760N/A * See the License for the specific language governing permissions 760N/A * and limitations under the License. 760N/A * When distributing Covered Code, include this CDDL HEADER in each 6982N/A * If applicable, add the following below this CDDL HEADER, with the 6982N/A * fields enclosed by brackets "[]" replaced with your own identifying 760N/A * Portions Copyright [yyyy] [name of copyright owner] 4450N/A * Copyright 2008-2009 Sun Microsystems, Inc. 760N/A * This class contains a number of test cases for the proxied authorization v1 760N/A * Make sure that the server is running. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the first constructor, which creates an instance of the control using 760N/A * a raw, unprocessed DN. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A // Try a DN of "null", which is not valid and will fail on the attempt to 760N/A "auth V1 control with a null octet string.");
760N/A // Try an empty DN, which is acceptable. 760N/A // Try a valid DN, which is acceptable. 760N/A // Try an invalid DN, which will be initally accepted but will fail when 760N/A // attempting to get the authorization DN. 760N/A "auth V1 control with an invalid DN string.");
760N/A * Tests the second constructor, which creates an instance of the control 760N/A * using a processed DN. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A // Try a DN of "null", which is not valid and will fail on the attempt to 760N/A "auth V1 control with a null octet string.");
760N/A // Try an empty DN, which is acceptable. 760N/A // Try a valid DN, which is acceptable. 760N/A * Tests the {@code decodeControl} method when the provided control has a 760N/A * criticality of "false". 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code decodeControl} method when the provided control does not 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code decodeControl} method when the control value is not a 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code decodeControl} method when the control value is a sequence 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code decodeControl} method when the control value is a sequence 760N/A * with multiple elements. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code decodeControl} method when the control value is a valid 760N/A * octet string that contains an invalid DN. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code decodeControl} method when the control value is a valid 760N/A * octet string that contains an valid empty DN. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code decodeControl} method when the control value is a valid 760N/A * octet string that contains an valid non-empty DN. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code getRawAuthorizationDN} and {@code setRawAuthorizationDN} 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code getAuthorizationDN} and {@code setRawAuthorizationDN} 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code getValidatedAuthorizationDN} method for the null DN. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code getValidatedAuthorizationDN} method for a normal user 760N/A * that exists in the directory data and doesn't have any restrictions on its 760N/A * @throws Exception If an unexpected problem occurs. 760N/A "objectClass: organizationalPerson",
760N/A "objectClass: inetOrgPerson",
760N/A * Tests the {@code getValidatedAuthorizationDN} method for a user that 760N/A * doesn't exist in the directory data. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A * Tests the {@code getValidatedAuthorizationDN} method for a disabled user. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A "objectClass: organizationalPerson",
760N/A "objectClass: inetOrgPerson",
760N/A "ds-pwp-account-disabled: true");
760N/A * Tests the {@code toString} methods. 760N/A * @throws Exception If an unexpected problem occurs. 760N/A // The default toString() calls the version that takes a string builder 760N/A // argument, so we only need to use the default version to cover both cases.