InternalConnectionHandlerTestCase.java revision e433824f46514e6ed863eb6b95c70038331c8c24
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * CDDL HEADER START
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * The contents of this file are subject to the terms of the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Common Development and Distribution License, Version 1.0 only
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * (the "License"). You may not use this file except in compliance
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * with the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * or http://forgerock.org/license/CDDLv1.0.html.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * See the License for the specific language governing permissions
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * and limitations under the License.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * When distributing Covered Code, include this CDDL HEADER in each
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * file and include the License file at legal-notices/CDDLv1_0.txt.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * If applicable, add the following below this CDDL HEADER, with the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * fields enclosed by brackets "[]" replaced with your own identifying
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * information:
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Portions Copyright [yyyy] [name of copyright owner]
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * CDDL HEADER END
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Copyright 2006-2009 Sun Microsystems, Inc.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Portions Copyright 2015 ForgeRock AS
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshottimport org.opends.server.api.ClientConnection;
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * This class defines a set of tests for the
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * org.opends.server.protocols.internal.InternalConnectionHandler class.
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshottpublic class InternalConnectionHandlerTestCase
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott * Retrieves an instance of the connection handler and initializes it.
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott * @throws Exception If an unexpected problem occurs.
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott InternalConnectionHandler handler = InternalConnectionHandler.getInstance();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster handler.initializeConnectionHandler(mock(ServerContext.class), null);
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Tests the <CODE>finalizeConnectionHandler</CODE> method.
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott InternalConnectionHandler handler = InternalConnectionHandler.getInstance();
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott * Tests the <CODE>getClientConnections</CODE> method.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster InternalConnectionHandler handler = InternalConnectionHandler.getInstance();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster Collection<ClientConnection> connections = handler.getClientConnections();
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * Tests the <CODE>run</CODE> method. This will make sure that it returns as
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster * expected rather than actually running as a thread.
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster public void testRun()
8af80418ba1ec431c8027fa9668e5678658d3611Allan Foster InternalConnectionHandler handler = InternalConnectionHandler.getInstance();
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott * Tests the first <CODE>toString</CODE> method, which doesn't take any
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott InternalConnectionHandler handler = InternalConnectionHandler.getInstance();
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott * Tests the second <CODE>toString</CODE> method, which takes a
d0da70ccbba38b773e7a7cc71bc124b06206d201Robert Wapshott * <CODE>StringBuilder</CODE> argument.