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

matthew_swift
30.14.2007 e37077ea552a101d04e834ef50b24d0d06c6e498
Fix issue 2192: dsconfig delete-backend doesn't work

The delete-xxx sub-command was silently failing in non-interactive mode because it was silently prompting for confirmation and defaulting to "no". This change also re-enables the file system entry cache unit tests which were failing as a result of this bug.
2 files modified
26 ■■■■ changed files
opends/src/server/org/opends/server/tools/dsconfig/DeleteSubCommandHandler.java 22 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/FileSystemEntryCacheTestCase.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/tools/dsconfig/DeleteSubCommandHandler.java
@@ -329,18 +329,20 @@
  // Confirm deletion.
  private boolean confirmDeletion(ConsoleApplication app) throws CLIException {
    Message prompt = INFO_DSCFG_CONFIRM_DELETE.get(relation
        .getUserFriendlyName());
    app.println();
    if (!app.confirmAction(prompt, false)) {
      // Output failure message.
      Message msg = INFO_DSCFG_CONFIRM_DELETE_FAIL.get(relation
    if (app.isInteractive()) {
      Message prompt = INFO_DSCFG_CONFIRM_DELETE.get(relation
          .getUserFriendlyName());
      app.printVerboseMessage(msg);
      return false;
    } else {
      return true;
      app.println();
      if (!app.confirmAction(prompt, false)) {
        // Output failure message.
        Message msg = INFO_DSCFG_CONFIRM_DELETE_FAIL.get(relation
            .getUserFriendlyName());
        app.printVerboseMessage(msg);
        return false;
      }
    }
    return true;
  }
}
opends/tests/unit-tests-testng/src/server/org/opends/server/extensions/FileSystemEntryCacheTestCase.java
@@ -619,7 +619,7 @@
  /**
   * Tests cache persistence with consistent backend.
   */
  @Test(enabled=false, groups = "slow")
  @Test(groups = "slow")
  @SuppressWarnings("unchecked")
  public void testCachePersistence()
         throws Exception
@@ -672,7 +672,7 @@
  /**
   * Tests cache persistence with inconsistent backend.
   */
  @Test(enabled=false, groups = "slow")
  @Test(groups = "slow")
  @SuppressWarnings("unchecked")
  public void testCachePersistenceInconsistent()
         throws Exception