/*
* 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
* 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
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. 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 2008 Sun Microsystems, Inc.
*/
/**
* This class provides a number of tests to cover the internal LDAP socket
* implementation.
*/
public class InternalLDAPSocketTestCase
extends InternalTestCase
{
/**
* Ensures that the Directory Server is running.
*
* @throws Exception If an unexpected problem occurs.
*/
@BeforeClass()
public void startServer()
throws Exception
{
}
/**
* Tests the ability to perform an add operation over the internal LDAP
* socket.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testAddOperation()
throws Exception
{
TestCaseUtils.initializeTestBackend(false);
}
/**
* Tests the ability to perform an add operation over the internal LDAP
* socket via JNDI.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testAddOperationThroughJNDI()
throws Exception
{
TestCaseUtils.initializeTestBackend(false);
"com.sun.jndi.ldap.LdapCtxFactory");
InternalLDAPSocketFactory.class.getName());
o.add("test");
attributes.put(o);
}
/**
* Tests the ability to perform a compare operation over the internal LDAP
* socket.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testCompareOperation()
throws Exception
{
}
/**
* Tests the ability to perform a compare operation over the internal LDAP
* socket via JNDI.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testCompareOperationThroughJNDI()
throws Exception
{
"com.sun.jndi.ldap.LdapCtxFactory");
InternalLDAPSocketFactory.class.getName());
}
/**
* Tests the ability to perform a delete operation over the internal LDAP
* socket.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testDeleteOperation()
throws Exception
{
}
/**
* Tests the ability to perform a delete operation over the internal LDAP
* socket via JNDI.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testDeleteOperationThroughJNDI()
throws Exception
{
"com.sun.jndi.ldap.LdapCtxFactory");
InternalLDAPSocketFactory.class.getName());
}
/**
* Tests the ability to perform an extended operation over the internal LDAP
* socket using the "Who Am I?" request.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testExtendedOperation()
throws Exception
{
"dn:cn=Directory Manager,cn=Root DNs,cn=config"));
}
/**
* Tests the ability to perform a modify operation over the internal LDAP
* socket.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testModifyOperation()
throws Exception
{
"foo"));
}
/**
* Tests the ability to perform a modify operation over the internal LDAP
* socket via JNDI.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testModifyOperationThroughJNDI()
throws Exception
{
"com.sun.jndi.ldap.LdapCtxFactory");
InternalLDAPSocketFactory.class.getName());
ModificationItem[] mods =
{
};
}
/**
* Tests the ability to perform a modify DN operation over the internal LDAP
* socket.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testModifyDNOperation()
throws Exception
{
"dn: ou=People,o=test",
"objectClass: top",
"objectClass: organizationalUnit",
"ou: People");
}
/**
* Tests the ability to perform a modify DN operation over the internal LDAP
* socket via JNDI.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testModifyDNOperationThroughJNDI()
throws Exception
{
"dn: ou=People,o=test",
"objectClass: top",
"objectClass: organizationalUnit",
"ou: People");
"com.sun.jndi.ldap.LdapCtxFactory");
InternalLDAPSocketFactory.class.getName());
}
/**
* Tests the ability to perform a search operation over the internal LDAP
* socket.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testSearchOperation()
throws Exception
{
0, 0, false,
new LinkedHashSet<String>());
}
/**
* Tests the ability to perform a searcj operation over the internal LDAP
* socket via JNDI.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testSearchOperationThroughJNDI()
throws Exception
{
"com.sun.jndi.ldap.LdapCtxFactory");
InternalLDAPSocketFactory.class.getName());
}
}