InternalSearchOperationTestCase.java revision 2efcb9667318c099d8723dd578f198c16b4a22c4
/*
* 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 2006-2008 Sun Microsystems, Inc.
*/
/**
* This class defines a set of tests for the
* org.opends.server.protocols.internal.InternalSearchOperation class.
*/
public class InternalSearchOperationTestCase
extends InternalTestCase
{
/**
* Ensures that the Directory Server is running.
*
* @throws Exception If an unexpected problem occurs.
*/
@BeforeClass()
public void startServer()
throws Exception
{
}
/**
* Tests the first constructor, which takes raw arguments, without providing
* an internal search listener.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testConstructor1WithoutListener()
throws Exception
{
}
/**
* Tests the first constructor, which takes raw arguments, with an internal
* search listener.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testConstructor1WithListener()
throws Exception
{
new LinkedHashSet<String>(),
new TestInternalSearchListener());
}
/**
* Tests the second constructor, which takes processed arguments, without
* providing an internal search listener.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testConstructor2WithoutListener()
throws Exception
{
false, searchFilter,
}
/**
* Tests the second constructor, which takes processed arguments, with an
* internal search listener.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testConstructor2WithListener()
throws Exception
{
false, searchFilter,
new LinkedHashSet<String>(),
new TestInternalSearchListener());
}
/**
* Tests the <CODE>getSearchEntries</CODE> and
* <CODE>getSearchReferences</CODE> methods.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testGetSearchEntriesAndReferences()
throws Exception
{
}
/**
* Tests the <CODE>addSearchEntry</CODE> method without a search listener.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testAddSearchEntryWithoutListener()
throws Exception
{
ByteString.empty(),
0, false,
"objectClass: top",
"objectClass: ds-root-dse");
}
/**
* Tests the <CODE>addSearchEntry</CODE> method with a search listener.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testAddSearchEntryWithListener()
throws Exception
{
ByteString.empty(),
0, false,
new LinkedHashSet<String>(),
new TestInternalSearchListener());
"objectClass: top",
"objectClass: ds-root-dse");
}
/**
* Tests the <CODE>addSearchReference</CODE> method without a search listener.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testAddSearchReferenceWithoutListener()
throws Exception
{
ByteString.empty(),
0, false,
new SearchResultReference("ldap://server.example.com:389/");
}
/**
* Tests the <CODE>addSearchReference</CODE> method with a search listener.
*
* @throws Exception If an unexpected problem occurs.
*/
@Test()
public void testAddSearchReferenceWithListener()
throws Exception
{
ByteString.empty(),
0, false,
new LinkedHashSet<String>(),
new TestInternalSearchListener());
new SearchResultReference("ldap://server.example.com:389/");
}
}