From 84e187d76943fe5bb6f9537968e351d36add94d8 Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Fri, 04 Jul 2014 08:18:20 +0000
Subject: [PATCH] OPENDJ-1505 (CR-3946) OpenDJ SDK tools prompt for user credentials even when none are needed * ConnectionFactoryProvider.java DSConfig.java ** Refactoring code by removing unused constructor and fields ** Perform anonymous connection by default * src/main[..]/ldap/tools/*.java ** Making tools not interactive * src/test[..]/ldap/tools/*.java ** Adding some basic integration tests cases to ensure that general tools behavior is ok * pom.xml ** Update and clean dependencies
---
opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
index 9a5a2d1..5d39099 100644
--- a/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
+++ b/opendj-ldap-toolkit/src/main/java/com/forgerock/opendj/ldap/tools/LDAPSearch.java
@@ -35,6 +35,7 @@
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
+import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;
@@ -214,6 +215,16 @@
// Nothing to do.
}
+ /**
+ * Constructor to allow tests.
+ *
+ * @param out output stream of console application
+ * @param err error stream of console application
+ */
+ LDAPSearch(PrintStream out, PrintStream err) {
+ super(out, err);
+ }
+
/** {@inheritDoc} */
public boolean isInteractive() {
return false;
@@ -225,7 +236,8 @@
return verbose.isPresent();
}
- private int run(final String[] args, final boolean returnMatchingEntries) {
+ /** Run ldapsearch with provided command-line arguments. **/
+ int run(final String[] args, final boolean returnMatchingEntries) {
/* Create the command-line argument parser for use with this
program.*/
final LocalizableMessage toolDescription = INFO_LDAPSEARCH_TOOL_DESCRIPTION.get();
--
Gitblit v1.10.0