mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

coulbeck
26.37.2007 2ee035bf164fe1976b7c51b0f248322ae6dcb33e
opends/tests/unit-tests-testng/src/server/org/opends/server/tools/EncodePasswordTestCase.java
@@ -29,7 +29,6 @@
import java.io.File;
import java.io.FileWriter;
import java.util.ArrayList;
import org.testng.annotations.BeforeClass;
@@ -37,18 +36,11 @@
import org.testng.annotations.Test;
import org.opends.server.TestCaseUtils;
import org.opends.server.core.AddOperation;
import org.opends.server.core.DirectoryServer;
import org.opends.server.protocols.internal.InternalClientConnection;
import org.opends.server.protocols.ldap.LDAPResultCode;
import org.opends.server.types.Entry;
import org.opends.server.types.OperatingSystem;
import org.opends.server.types.ResultCode;
import org.opends.server.util.Base64;
import static org.testng.Assert.*;
import static org.opends.server.util.ServerConstants.*;
@@ -61,9 +53,12 @@
  // The path to the Directory Server configuration file.
  private String configFilePath;
  // The path to the temporary file containing a password.
  // The path to the temporary file containing a clear-text password.
  private String passwordFilePath;
  // The path to the temporary file containing an encoded password.
  private String encodedPasswordFilePath;
  /**
@@ -81,6 +76,9 @@
                     "config" + File.separator + "config.ldif";
    passwordFilePath = TestCaseUtils.createTempFile("password");
    encodedPasswordFilePath =
         TestCaseUtils.createTempFile("{SHA}C5wmJdwh7wX2rU3fR8XyA4N6oyw=");
  }
@@ -462,6 +460,25 @@
  /**
   * Tests the EncodePassword tool by performing a comparison of clear-text
   * with a valid matching encoded password.
   */
  @Test()
  public void testCompareMatchingEncodedPasswordsFromFile()
  {
    String[] args =
    {
      "--configFile", configFilePath,
      "--clearPasswordFile", passwordFilePath,
      "--encodedPasswordFile", encodedPasswordFilePath
    };
    assertEquals(EncodePassword.encodePassword(args, false, null, null), 0);
  }
  /**
   * Tests the EncodePassword tool by performing a comparison of clear-text
   * with a valid matching auth password.
   */
  @Test()