OperationTestCase.java revision ea1068c292e9b341af6d6b563cd8988a96be20a9
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS
*/
/**
* A set of generic test cases for operations
*/
public abstract class OperationTestCase
extends CoreTestCase
{
/** The LDAPStatistics object associated with the LDAP connection handler. */
protected LDAPStatistics ldapStatistics;
/** The LDAPStatistics object associated with the LDAPS connection handler. */
protected LDAPStatistics ldapsStatistics;
public void setUpQuiesceServer()
{
}
/**
* When this was part of an @BeforeClass method, it was not called reliably
* for each subclass.
*/
public void initializeLDAPStatistics()
{
{
if (ch instanceof LDAPConnectionHandler)
{
{
}
else
{
}
}
}
}
/**
* Since the PostResponse plugins are called after the response is sent
* back to the client, a client (e.g. a test case) can get a response before
* the PostResponse plugins have been called. So that we can verify that the
* PostResponse plugins were called, the tests call this method to ensure
* that all operations in the server have been completed.
*/
protected void ensurePostReponseHasRun()
{
}
/**
* Ensures that the Directory Server is running.
*
* @throws Exception If an unexpected problem occurs.
*/
public void startServer()
throws Exception
{
}
/**
* Creates a set of valid operation instances of this type that may be used
* for testing the general methods defined in the Operation superclass. Only
* the constructors for the operation need to be used -- it does not require
* any further initialization (no tests will be performed that require any
* further processing).
*
* @return A set of operation instances of this type that may be used for
* testing the general methods defined in the Operation superclass.
*
* @throws Exception If an unexpected problem occurs.
*/
protected abstract Operation[] createTestOperations()
throws Exception;
/**
* Retrieves a set of valid operation instances that may be used to test
* methods common to all operations.
*
* @return A set of valid operation instances that may be used to test
* methods common to all operations.
*
* @throws Exception If an unexpected problem occurs.
*/
public Object[][] getTestOperations()
throws Exception
{
{
}
return objectArray;
}
/**
* Tests the <CODE>getOperationType</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getClientConnection</CODE> method for the provided
* operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getConnectionID</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getOperationID</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getMessageID</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getRequestControls</CODE> method for the provided
* operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getResponseControls</CODE> method for the provided
* operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getResultCode</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getErrorMessage</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getMatchedDN</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getReferralURLs</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>isInternalOperation</CODE> method for the provided \
* operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>isSynchronizationOperation</CODE> method for the provided
* operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getAuthorizationDN</CODE> method for the provided
* operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getMatchedDN</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getCancelRequest</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>getCancelResult</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>toString</CODE> method for the provided operation.
*
* @param operation The operation to test.
*/
{
}
/**
* Tests the <CODE>addResponseControl</CODE> and
* <CODE>removeResponseControl</CODE> methods.
*
* @param operation The operation to test.
*/
{
{
}
}
/**
* Checking ldapStatistics.getModifyResponses() too soon can lead to
* problems since we can see the response before the statistic is
* incremented, so we're a little more forgiving.
*/
protected void waitForModifyResponsesStat(long expectedValue)
{
for (int i = 0; i < 10; i++) {
return;
}
}
}
/**
* Checking ldapStatistics.getAddResponses() too soon can lead to
* problems since we can see the response before the statistic is
* incremented, so we're a little more forgiving.
*/
protected void waitForAddResponsesStat(long expectedValue)
{
for (int i = 0; i < 10; i++) {
return;
}
}
}
}