/*
* 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-2008 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS
*/
/**
* This class defines a set of tests for the
* org.opends.server.protocol.ldap.AddRequestProtocolOp class.
*/
{
/** The protocol op type for add requests. */
/** The protocol op type for add responses. */
/** The DN for add requests in this test case. */
/**
* Generate attributes for use in test cases. Attributes will have names
* like "testAttributeN" where N is the number of the attribute. Values will
* have the value of "testValueN.K" where N is the attribute number and K
* is the value number.
*
* @param numAttributes Number of attributes to generate. 0 will return
* a empty list.
* @param numValues Number of values to assign to each attribute. 0 will
* assign a empty list of values to the attribute.
* @param prefix String to prefix the attribute values
* @return The generate attributes.
*
*/
int numValues,
{
for (int i = 0; i < numAttributes; i++)
{
for (int j = 0; j < numValues; j++)
{
}
}
return attributes;
}
{
{
return false;
}
{
{
return false;
}
{
return false;
}
{
{
return false;
}
}
}
return true;
}
/**
* Test to make sure the class processes the right LDAP op type.
*
* @throws Exception If the test failed unexpectedly.
*/
@Test
{
}
/**
* Test to make sure the class returns the correct protocol name.
*
* @throws Exception If the test failed unexpectedly.
*/
@Test
{
}
/**
* Test the constructors to make sure the right objects are constructed.
*
* @throws Exception If the test failed unexpectedly.
*/
@Test
{
//Test to make sure the constructor with dn param works.
//Test to make sure the constructor with dn and attribute params works.
//Test to make sure the constructor with dn and attribute params works with
//null attributes.
}
/**
* Test the decode method when an null element is passed
*
* @throws Exception If the test failed unexpectedly.
*/
{
}
/**
* Test the decode method when an empty element is passed
*
* @throws Exception If the test failed unexpectedly.
*/
{
}
/**
* Test the decode method when invalid attributes in element is passed
*
* @throws Exception If the test failed unexpectedly.
*/
{
}
/**
* Test the decode method when an element w/ wrong op type is passed.
*
* @throws Exception If the test failed unexpectedly.
*/
{
}
/**
* Test the encode and decode methods with null params
*
* @throws Exception If the test failed unexpectedly.
*/
{
}
/**
* Test the encode and decode methods and corner cases.
*
* @throws Exception If the test failed unexpectedly.
*/
@Test
{
//Test case for a full encode decode operation with normal params.
addDecoded.getAttributes()));
//Test case for a full encode decode operation with large attributes.
addDecoded.getAttributes()));
//Test case for a full encode decode operation with no attributes.
addDecoded.getAttributes()));
}
/**
* Test toLDIF method.
*
* @throws Exception If the test fails unexpectedly.
*/
@Test
{
int numAttributes = 10;
int numValues = 5;
for (int i = 0; i < numAttributes; i++)
{
for (int j = 0; j < numValues; j++)
{
}
}
}
/**
* Test toLDIF method with values that need base64 encoding.
*
* @throws Exception If the test fails unexpectedly.
*/
@Test
{
int numAttributes = 10;
int numValues = 5;
for (int i = 0; i < numAttributes; i++)
{
for (int j = 0; j < numValues; j++)
{
}
}
}
/**
* Test the toString (single line) method.
*
* @throws Exception If the test fails unexpectedly.
*/
@Test
{
int numAttributes = 10;
int numValues = 5;
for (int i = 0; i < numAttributes; i++)
{
if(i < numAttributes - 1)
{
}
}
}
/**
* Test the toString (multi line) method.
*
* @throws Exception If the test fails unexpectedly.
*/
@Test
{
int numAttributes = 10;
int numValues = 5;
int indent = 5;
for (int i = 0; i < indent; i++)
{
}
{
}
}
}