/*
* 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 2013-2015 ForgeRock AS.
*/
/**
* This class defines a set of tests for the StaticUtils.class.
* <p>
* Reminder :
*
* <pre>
* to - from SDK to server.
* from - from server to SDK.
* </pre>
*/
@SuppressWarnings("javadoc")
@Test(sequential=true)
/**
* Launched before the tests, this function starts the embedded server.
*
* @throws Exception
* If the server could not be initialized.
*/
}
/**
* Converts a SDK {@link SearchResultEntry} to an LDAP Server
* {@link SearchResultEntry}.
*/
@Test
.valueOf("uid=scarter,ou=People,dc=example,dc=com"));
}
}
/**
* Converts a SDK {@link Entry} to an LDAP Server
* {@link Entry}.
*/
@Test
.valueOf("uid=scarter,ou=People,dc=example,dc=com"));
}
/**
* Converts a SDK Distinguished Name to a LDAP server Distinguish Name. Needs
* a running server to work.
*
* @throws DirectoryException
*/
}
@Test
}
/**
* Converts a SDK control to a LDAP server control.
*
* @throws DirectoryException
*/
@Test
PersistentSearchRequestControl.newControl(false, true,
true, // isCritical, changesOnly, returnECs
// control :
// PersistentSearchRequestControl(oid=2.16.840.1.113730.3.4.3, criticality=true,
// changeTypes=[add, delete, modify, modifyDN]([add, delete, modify, modifyDN]),
// changesOnly=true, returnECs=true)
// A PostReadRequestControl(SDK)
final PostReadRequestControl control2 =
}
/**
* Converts a list of SDK controls to a list of LDAP server controls.
*
* @throws DirectoryException
*/
@Test
}
PersistentSearchRequestControl.newControl(false, true,
true, // isCritical, changesOnly, returnECs
final PostReadRequestControl control2 =
final ProxiedAuthV2RequestControl control3 =
.newControl("dn:uid=kvaughan,ou=People,dc=example,dc=com");
}
/**
* Converts an SDK attribute to an LDAP server attribute.
*/
@Test
}
}
/**
* Converts an SDK multi-valued attribute to an LDAP Server Attribute.
*/
.isEqualTo("testMultiValuedAttribute");
"value4");
"AnotherMultiValuedAttribute");
}
@Test
.isEqualTo("testMultiValuedAttribute");
"value4");
.isEqualTo("AnotherMultiValuedAttribute");
}
/**
* Converts a SDK modification to an LDAP server raw modification.
*/
@Test
public final void testToRawModification() {
.valueOfUtf8("value2"));
}
@Test
public final void testToModification() {
.valueOfUtf8("value2"));
}
/**
* Converts a SDK filter to an LDAP server filter.
*/
@Test
}
/**
* Converts a SDK search result reference to a LDAP server search result
* reference.
*/
@Test
new SearchResultReference(uri);
}
/**
* Converts an LDAP attribute to an SDK attribute.
*/
}
/**
* Converts an LDAP attribute to an SDK attribute using binary attribute value.
*/
}
/**
* Converts an LDAP control to an SDK control.
*/
@Test
public static void testFromLDAPControl() {
}
/**
* Converts an Scope to an SDK Scope.
*/
@Test
public static void testFromScope() {
// WHOLE SUBTREE
assertThat(org.forgerock.opendj.ldap.SearchScope.WHOLE_SUBTREE).isEqualTo(from(Scope.WHOLE_SUBTREE));
// BASE OBJECT
// SINGLE LEVEL
// SUBORDINATE
assertThat(org.forgerock.opendj.ldap.SearchScope.SUBORDINATES).isEqualTo(from(Scope.SUBORDINATE_SUBTREE));
}
/**
* Converts a server control to an SDK control.
*/
@Test
public static void testFromControl() {
}
/**
* Converts a a LDAP server Distinguish Name to a SDK Distinguished Name.
*
* @throws DirectoryException
*/
@Test
}
/**
* For an SASL bind request, credentials are composed by uid and password
* (in this config).
*/
final PlainSASLBindRequest request =
}
/**
* For an CRAMMD5 SALS request, the credentials are empty.
*/
final CRAMMD5SASLBindRequest request =
ByteString.empty());
}
return new Object[][] {
{ BindOperation.class, BindResult.class },
{ CompareOperation.class, CompareResult.class },
{ SearchOperation.class, Result.class },
};
}
/** Tests the type of the result based on the type of the provided operation. */
// Given
// When
// Then
}
return new Object[][] {
{ "", GenericExtendedResult.class },
};
}
/** Tests the type of the result based on the type of the provided operation. */
// Given
// When
// Then
}
}