From 4cb2749aff182db1da02dbda4e4c431d5ed14fc4 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Thu, 15 Mar 2007 18:13:30 +0000
Subject: [PATCH] Update the LDAPSearch tool so that the "--noop" option works as expected. If it is provided, then the tool will verify that all of the arguments are valid but will not actually attempt any network communication.
---
opends/tests/unit-tests-testng/src/server/org/opends/server/tools/LDAPSearchTestCase.java | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 50 insertions(+), 0 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 1b3a149..4521eed 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
@@ -566,6 +566,56 @@
/**
+ * Tests a simple invocation using the "--noop" option with a valid argument
+ * set.
+ */
+ @Test()
+ public void testNoOpSearchValidArguments()
+ {
+ String[] args =
+ {
+ "-h", "doesnt.need.to.resolve",
+ "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
+ "-V", "3",
+ "-D", "cn=Directory Manager",
+ "-w", "password",
+ "-b", "",
+ "-s", "base",
+ "--noop",
+ "(objectClass=*)"
+ };
+
+ assertEquals(LDAPSearch.mainSearch(args, false, null, System.err), 0);
+ }
+
+
+
+ /**
+ * Tests a simple invocation using the "--noop" option with an invalid
+ * argument set.
+ */
+ @Test()
+ public void testNoOpSearchInvalidArguments()
+ {
+ String[] args =
+ {
+ "-h", "doesnt.need.to.resolve",
+ "-p", String.valueOf(TestCaseUtils.getServerLdapPort()),
+ "-V", "3",
+ "-D", "cn=Directory Manager",
+ "-w", "password",
+ "-b", "",
+ "-s", "invalid",
+ "--noop",
+ "(objectClass=*)"
+ };
+
+ assertFalse(LDAPSearch.mainSearch(args, false, null, System.err) == 0);
+ }
+
+
+
+ /**
* Tests a simple LDAP search over SSL using blind trust.
*/
@Test()
--
Gitblit v1.10.0