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

kenneth_suter
05.34.2007 d945fc3c8bf0f5bd3d6a6413dc29c774d2f896b1
added hook for testing the upgrader's ability to back out of an upgrade
1 files modified
18 ■■■■■ changed files
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java 18 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/quicksetup/org/opends/quicksetup/upgrader/Upgrader.java
@@ -234,6 +234,13 @@
          "org.opends.quicksetup.upgrader.CreateError";
  /**
   * If set to true, an error is introduced during the
   * upgrade verification process.
   */
  static private final String SYS_PROP_CREATE_VERIFY_ERROR =
          "org.opends.quicksetup.upgrader.VerifyError";
  /**
   * If set to true, if the upgrader encounters an error
   * during upgrade, the abort method that backs out
   * changes is made a no-op leaving the server in the
@@ -955,6 +962,17 @@
      ServerHealthChecker healthChecker = new ServerHealthChecker(installation);
      healthChecker.checkServer();
      List<String> errors = healthChecker.getProblemMessages();
      // For testing
      if ("true".equals(
              System.getProperty(SYS_PROP_CREATE_VERIFY_ERROR))) {
        LOG.log(Level.WARNING, "creating artificial verification error");
        if (errors == null || errors.size() == 0) {
          errors = new ArrayList<String>();
          errors.add("Artificial verification error for testing");
        }
      }
      if (errors != null && errors.size() > 0) {
        notifyListeners(formatter.getFormattedError() +
                formatter.getLineBreak());