From 9c7342f1aacd6104f02b696294ce479d9cbfad3d Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Mon, 05 Feb 2007 04:13:38 +0000
Subject: [PATCH] Update the ldapsearch tool to provide support for using the simple paged results control.
---
opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 56 insertions(+), 1 deletions(-)
diff --git a/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java b/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java
index 46f47aa..522bf5a 100644
--- a/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java
+++ b/opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Portions Copyright 2006 Sun Microsystems, Inc.
+ * Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
package org.opends.server.tools;
@@ -1471,6 +1471,61 @@
/**
+ * Tests the use of the simple paged results control.
+ *
+ * @throws Exception If an unexpectd problem occurs.
+ */
+ @Test()
+ public void testSimplePagedResults()
+ throws Exception
+ {
+ TestCaseUtils.clearJEBackend(true, "userRoot", "dc=example,dc=com");
+
+ TestCaseUtils.addEntries(
+ "dn: cn=device 1,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: device",
+ "cn: device 1",
+ "",
+ "dn: cn=device 2,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: device",
+ "cn: device 2",
+ "",
+ "dn: cn=device 3,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: device",
+ "cn: device 3",
+ "",
+ "dn: cn=device 4,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: device",
+ "cn: device 4",
+ "",
+ "dn: cn=device 5,dc=example,dc=com",
+ "objectClass: top",
+ "objectClass: device",
+ "cn: device 5");
+
+ String[] args =
+ {
+ "-h", "127.0.0.1",
+ "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
+ "-D", "cn=Directory Manager",
+ "-w", "password",
+ "-b", "dc=example,dc=com",
+ "-s", "one",
+ "--simplePageSize", "2",
+ "--countEntries",
+ "(objectClass=*)"
+ };
+
+ assertEquals(LDAPSearch.mainSearch(args, false, null, System.err), 5);
+ }
+
+
+
+ /**
* Tests the LDAPSearch tool with the "--help" option.
*/
@Test()
--
Gitblit v1.10.0