From 08a8540072a370b4e7e9604eb97818dcfd4d74c6 Mon Sep 17 00:00:00 2001
From: Gaetan Boismal <gaetan.boismal@forgerock.com>
Date: Mon, 31 Oct 2016 14:00:38 +0000
Subject: [PATCH] OPENDJ-2773 Remove duplicated server tools

---
 opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java b/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
index 20ac02b..30cb4ec 100644
--- a/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
+++ b/opendj-server-legacy/src/test/java/org/opends/server/api/PasswordValidatorTestCase.java
@@ -19,6 +19,7 @@
 import static org.forgerock.opendj.ldap.ModificationType.*;
 import static org.forgerock.opendj.ldap.requests.Requests.*;
 import static org.opends.server.TestCaseUtils.*;
+import static org.opends.server.types.NullOutputStream.nullPrintStream;
 import static org.testng.Assert.*;
 
 import java.util.Set;
@@ -29,7 +30,7 @@
 import org.opends.server.extensions.TestPasswordValidator;
 import org.opends.server.protocols.ldap.LDAPMessage;
 import org.opends.server.protocols.ldap.ModifyResponseProtocolOp;
-import org.opends.server.tools.LDAPPasswordModify;
+import com.forgerock.opendj.ldap.tools.LDAPPasswordModify;
 import org.opends.server.tools.RemoteConnection;
 import org.testng.annotations.AfterClass;
 import org.testng.annotations.BeforeClass;
@@ -115,8 +116,7 @@
       "-c", "password",
       "-n", "newPassword"
     };
-    assertEquals(LDAPPasswordModify.mainPasswordModify(args, false, null, null),
-                 0);
+    assertEquals(LDAPPasswordModify.run(nullPrintStream(), nullPrintStream(), args), 0);
 
     assertEquals(TestPasswordValidator.getLastNewPassword(),
                  ByteString.valueOfUtf8("newPassword"));
@@ -165,8 +165,7 @@
       "-n", "newPassword"
     };
 
-    int returnCode = LDAPPasswordModify.mainPasswordModify(args, false, null,
-                                                           null);
+    int returnCode = LDAPPasswordModify.run(nullPrintStream(), nullPrintStream(), args);
     assertNotEquals(returnCode, 0);
 
     assertEquals(TestPasswordValidator.getLastNewPassword(),
@@ -214,8 +213,7 @@
       "-w", "password",
       "-n", "newPassword"
     };
-    assertEquals(LDAPPasswordModify.mainPasswordModify(args, false, null, null),
-                 0);
+    assertEquals(LDAPPasswordModify.run(nullPrintStream(), nullPrintStream(), args), 0);
 
     Set<ByteString> currentPasswords =
          TestPasswordValidator.getLastCurrentPasswords();
@@ -262,8 +260,7 @@
       "-c", "password",
       "-n", "newPassword"
     };
-    assertEquals(LDAPPasswordModify.mainPasswordModify(args, false, null, null),
-                 0);
+    assertEquals(LDAPPasswordModify.run(nullPrintStream(), nullPrintStream(), args), 0);
 
     Set<ByteString> currentPasswords =
          TestPasswordValidator.getLastCurrentPasswords();
@@ -314,8 +311,7 @@
       "-w", "password",
       "-n", "newPassword"
     };
-    assertEquals(LDAPPasswordModify.mainPasswordModify(args, false, null, null),
-                 0);
+    assertEquals(LDAPPasswordModify.run(nullPrintStream(), nullPrintStream(), args), 0);
 
     Set<ByteString> currentPasswords =
          TestPasswordValidator.getLastCurrentPasswords();
@@ -367,8 +363,7 @@
       "-c", "password",
       "-n", "newPassword"
     };
-    assertEquals(LDAPPasswordModify.mainPasswordModify(args, false, null, null),
-                 0);
+    assertEquals(LDAPPasswordModify.run(nullPrintStream(), nullPrintStream(), args), 0);
 
     Set<ByteString> currentPasswords =
          TestPasswordValidator.getLastCurrentPasswords();

--
Gitblit v1.10.0