TestLDAPConnectionHandler.java revision 1008
306N/A * The contents of this file are subject to the terms of the 306N/A * Common Development and Distribution License, Version 1.0 only 306N/A * (the "License"). You may not use this file except in compliance 306N/A * You can obtain a copy of the license at 306N/A * See the License for the specific language governing permissions 306N/A * and limitations under the License. 306N/A * When distributing Covered Code, include this CDDL HEADER in each 306N/A * file and include the License file at 306N/A * add the following below this CDDL HEADER, with the fields enclosed 873N/A * by brackets "[]" replaced with your own identifying information: 306N/A * Portions Copyright [yyyy] [name of copyright owner] 873N/A * Portions Copyright 2006-2007 Sun Microsystems, Inc. 306N/A * Once-only initialization. 306N/A * If an unexpected error occurred. 306N/A // This test suite depends on having the schema available, so we'll 306N/A * Creates two handlers, one which is SSL type. Then change some values via the setter 306N/A * @throws Exception if the handler cannot be instantiated. 306N/A "dn: cn=LDAP Connection Handler,cn=Connection Handlers,cn=config",
306N/A "objectClass: ds-cfg-connection-handler",
306N/A "objectClass: ds-cfg-ldap-connection-handler",
306N/A "cn: LDAP Connection Handler",
306N/A "ds-cfg-connection-handler-class: org.opends.server.protocols.ldap.LDAPConnectionHandler",
306N/A "ds-cfg-connection-handler-enabled: true",
306N/A "ds-cfg-listen-address: 0.0.0.0",
306N/A "ds-cfg-accept-backlog: 128",
306N/A "ds-cfg-allow-ldapv2: false",
306N/A "ds-cfg-keep-stats: false",
306N/A "ds-cfg-use-tcp-keepalive: true",
306N/A "ds-cfg-use-tcp-nodelay: true",
306N/A "ds-cfg-allow-tcp-reuse-address: true",
306N/A "ds-cfg-send-rejection-notice: true",
306N/A "ds-cfg-max-request-size: 5 megabytes",
306N/A "ds-cfg-num-request-handlers: 2",
306N/A "ds-cfg-allow-start-tls: false",
306N/A "ds-cfg-use-ssl: false",
306N/A "ds-cfg-ssl-client-auth-policy: optional",
306N/A "ds-cfg-ssl-cert-nickname: server-cert");
306N/A //Reset some things for the SSL handler 306N/A * Start a handler an then give its hasAcceptableConfiguration a ConfigEntry with 308N/A * numerous invalid cases and single-valued attrs with duplicate values. 306N/A * @throws Exception if handler cannot be instantiated or the configuration is 306N/A "dn: cn=LDAP Connection Handler,cn=Connection Handlers,cn=config",
306N/A "objectClass: ds-cfg-connection-handler",
306N/A "objectClass: ds-cfg-ldap-connection-handler",
306N/A "cn: LDAP Connection Handler",
306N/A "ds-cfg-connection-handler-class: org.opends.server.protocols.ldap.LDAPConnectionHandler",
306N/A "ds-cfg-connection-handler-enabled: true",
306N/A "ds-cfg-listen-address: 0.0.0.0",
306N/A "ds-cfg-accept-backlog: 128",
306N/A "ds-cfg-allow-ldapv2: false",
306N/A "ds-cfg-keep-stats: false",
306N/A "ds-cfg-use-tcp-keepalive: true",
306N/A "ds-cfg-use-tcp-nodelay: true",
306N/A "ds-cfg-allow-tcp-reuse-address: true",
306N/A "ds-cfg-send-rejection-notice: true",
306N/A "ds-cfg-max-request-size: 5 megabytes",
306N/A "ds-cfg-num-request-handlers: 2",
306N/A "ds-cfg-allow-start-tls: false",
306N/A "ds-cfg-use-ssl: false",
306N/A "ds-cfg-ssl-client-auth-policy: optional",
306N/A "ds-cfg-ssl-cert-nickname: server-cert");
1008N/A // Add some invalid attrs and some duplicate attrs 306N/A * Create handler and then change most of its values and see if 306N/A * it is acceptable and applied. 306N/A * @throws Exception if handler cannot be instantiated. 306N/A "dn: cn=LDAP Connection Handler,cn=Connection Handlers,cn=config",
306N/A "objectClass: ds-cfg-connection-handler",
306N/A "objectClass: ds-cfg-ldap-connection-handler",
306N/A "cn: LDAP Connection Handler",
306N/A "ds-cfg-connection-handler-class: org.opends.server.protocols.ldap.LDAPConnectionHandler",
306N/A "ds-cfg-connection-handler-enabled: true",
306N/A "ds-cfg-listen-address: 0.0.0.0",
306N/A "ds-cfg-accept-backlog: 128",
306N/A "ds-cfg-allow-ldapv2: false",
306N/A "ds-cfg-keep-stats: false",
306N/A "ds-cfg-use-tcp-keepalive: true",
306N/A "ds-cfg-use-tcp-nodelay: true",
306N/A "ds-cfg-allow-tcp-reuse-address: true",
306N/A "ds-cfg-send-rejection-notice: true",
306N/A "ds-cfg-max-request-size: 5 megabytes",
306N/A "ds-cfg-num-request-handlers: 2",
306N/A "ds-cfg-allow-start-tls: false",
306N/A "ds-cfg-use-ssl: true",
306N/A "ds-cfg-ssl-client-auth-policy: optional",
306N/A "ds-cfg-ssl-cert-nickname: server-cert");
306N/A //Make attrTypes to remove 308N/A// AttributeType at1=DirectoryServer.getAttributeType(ATTR_LISTEN_ADDRESS, true); 308N/A// Attribute rAttr1=new Attribute(at1); 308N/A// GoodHandlerEntry.removeAttribute(rAttr1, null); 306N/A //Make new AttrTypes with different values 308N/A //uncomment if want to test listen address 308N/A// Attribute a3=new Attribute(ATTR_LISTEN_ADDRESS, "localhost"); 308N/A// GoodHandlerEntry.addAttribute(a3, null);