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

Gaetan Boismal
24.13.2015 4ac356097dcac43d825439af057c1480167842b4
OPENDJ-1886: Remove short option for testonly arg

***** opendj-cli *****
* ArgumentConstants.java
** Add constant for testonly long option

* CommonArguments.java
** Removes getTestOnly(...) static method as it is only used in InstallDS.

* cli.properties
** Removes INFO_ARGUMENT_DESCRIPTION_TESTONLY message and migrate it to server tool.properties to have consistant import in InstallDS.java

***** opendj-ldap-toolkit *****
* resources/.../_script_util.bat
** Replace short option call by long option call

***** opendj-server-legacy *****
* resources/.../bin/_script-util.sh _script-util.bat
** Replace short option call by long option call

* InstallDSArgumentParser.java
** Inline static call to CommonArguments

* tools.properties
** Add testonly argument information message
8 files modified
51 ■■■■■ changed files
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentConstants.java 3 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java 17 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-ldap-toolkit/src/main/assembly/libbat/_script-util.bat 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server-legacy/resource/bin/_script-util.bat 6 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server-legacy/resource/bin/_script-util.sh 10 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/tools/InstallDSArgumentParser.java 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opendj-server-legacy/src/messages/org/opends/messages/tool.properties 2 ●●●●● patch | view | raw | blame | history
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/ArgumentConstants.java
@@ -405,6 +405,9 @@
    /** Value for the restart option long form. */
    public static final String OPTION_LONG_RESTART = "restart";
    /** The value for the hidden testonly argument. */
    public static final String OPTION_LONG_TESTONLY_ARGUMENT = "testOnly";
    /** Prevent instantiation. */
    private ArgumentConstants() {
    }
opendj-sdk/opendj-cli/src/main/java/com/forgerock/opendj/cli/CommonArguments.java
@@ -304,23 +304,6 @@
    }
    /**
     * Returns the "testonly" boolean argument.
     * <br><i> N.B : the 't' short option is also used by targetldif, timelimit,
     * trustmanagerproviderdn, stoptime, start(dateTime)</i>
     *
     * @return The "testonly" argument.
     * @throws ArgumentException
     *             If there is a problem with any of the parameters used to create this argument.
     */
    public static BooleanArgument getTestOnly() throws ArgumentException {
        final BooleanArgument testOnly = new BooleanArgument("testOnly".toLowerCase(), 't', "testOnly",
                INFO_ARGUMENT_DESCRIPTION_TESTONLY.get());
        testOnly.setHidden(true);
        testOnly.setPropertyName("testOnly");
        return testOnly;
    }
    /**
     * Returns the "trustAll" boolean argument.
     *
     * @return The "trustAll" argument.
opendj-sdk/opendj-cli/src/main/resources/com/forgerock/opendj/cli/cli.properties
@@ -570,8 +570,6 @@
#
INFO_SETUP_TITLE=OPENDJ3 Setup tool
INFO_SETUP_DESCRIPTION=This utility can be used to setup the Directory Server
INFO_ARGUMENT_DESCRIPTION_TESTONLY=Just verify that the JVM can be \
 started properly
INFO_ARGUMENT_DESCRIPTION_CLI=Use the command line install. \
 If not specified the graphical interface will be launched.  The rest of the \
 options (excluding help and version) will only be taken into account if this \
opendj-sdk/opendj-ldap-toolkit/src/main/assembly/libbat/_script-util.bat
@@ -23,7 +23,7 @@
rem
rem
rem      Copyright 2008-2009 Sun Microsystems, Inc.
rem      Portions copyright 2013 ForgeRock AS.
rem      Portions copyright 2013-2015 ForgeRock AS.
set SET_JAVA_HOME_AND_ARGS_DONE=false
set SET_ENVIRONMENT_VARS_DONE=false
@@ -159,7 +159,7 @@
:notSupportedJavaHome
rem We get here when the java version is 5 (or up) but not supported.  We run
rem InstallDS again to see a localized message.
"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% org.opendj.server.tools.InstallDS -t
"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% org.opendj.server.tools.InstallDS --testonly
pause
exit /B 1
opendj-sdk/opendj-server-legacy/resource/bin/_script-util.bat
@@ -22,7 +22,7 @@
rem
rem
rem      Copyright 2008-2010 Sun Microsystems, Inc.
rem      Portions Copyright 2011-2014 ForgeRock AS
rem      Portions Copyright 2011-2015 ForgeRock AS
set SET_JAVA_HOME_AND_ARGS_DONE=false
set SET_ENVIRONMENT_VARS_DONE=false
@@ -182,7 +182,7 @@
:testJava
if "%OPENDJ_JAVA_ARGS%" == "" goto checkLegacyArgs
:continueTestJava
"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% org.opends.server.tools.InstallDS -t > NUL 2>&1
"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% org.opends.server.tools.InstallDS --testonly > NUL 2>&1
set RESULT_CODE=%errorlevel%
if %RESULT_CODE% == 13 goto notSupportedJavaHome
if not %RESULT_CODE% == 0 goto noValidJavaHome
@@ -215,7 +215,7 @@
:notSupportedJavaHome
rem We get here when the java version is 6 (or up) but not supported.  We run
rem InstallDS again to see a localized message.
"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% org.opends.server.tools.InstallDS -t
"%OPENDJ_JAVA_BIN%" %OPENDJ_JAVA_ARGS% org.opends.server.tools.InstallDS --testonly
pause
exit /B 1
opendj-sdk/opendj-server-legacy/resource/bin/_script-util.sh
@@ -23,7 +23,7 @@
#
#
#      Copyright 2008-2010 Sun Microsystems, Inc.
#      Portions Copyright 2010-2014 ForgeRock AS
#      Portions Copyright 2010-2015 ForgeRock AS
#
# Display an error message
@@ -177,13 +177,13 @@
test_java() {
  if test -z "${OPENDJ_JAVA_ARGS}"
  then
    "${OPENDJ_JAVA_BIN}" org.opends.server.tools.InstallDS -t 2> /dev/null
    "${OPENDJ_JAVA_BIN}" org.opends.server.tools.InstallDS --testonly 2> /dev/null
    RESULT_CODE=${?}
    if test ${RESULT_CODE} -eq 13
    then
      # This is a particular error code that means that the Java version is 6
      # but not supported.  Let InstallDS to display the localized error message
      "${OPENDJ_JAVA_BIN}" org.opends.server.tools.InstallDS -t
      "${OPENDJ_JAVA_BIN}" org.opends.server.tools.InstallDS --testonly
      exit 1
    elif test ${RESULT_CODE} -ne 0
    then
@@ -204,13 +204,13 @@
      exit 1
    fi
  else
    "${OPENDJ_JAVA_BIN}" ${OPENDJ_JAVA_ARGS} org.opends.server.tools.InstallDS -t 2> /dev/null
    "${OPENDJ_JAVA_BIN}" ${OPENDJ_JAVA_ARGS} org.opends.server.tools.InstallDS --testonly 2> /dev/null
    RESULT_CODE=${?}
    if test ${RESULT_CODE} -eq 13
    then
      # This is a particular error code that means that the Java version is 6
      # but not supported.  Let InstallDS to display the localized error message
      "${OPENDJ_JAVA_BIN}" org.opends.server.tools.InstallDS -t
      "${OPENDJ_JAVA_BIN}" org.opends.server.tools.InstallDS --testonly
      exit 1
    elif test ${RESULT_CODE} -ne 0
    then
opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/tools/InstallDSArgumentParser.java
@@ -125,7 +125,12 @@
   */
  public void initializeArguments() throws ArgumentException
  {
    testOnlyArg = CommonArguments.getTestOnly();
    testOnlyArg = new BooleanArgument(
            OPTION_LONG_TESTONLY_ARGUMENT.toLowerCase(), null,
            OPTION_LONG_TESTONLY_ARGUMENT,
            INFO_ARGUMENT_DESCRIPTION_TESTONLY.get());
    testOnlyArg.setHidden(true);
    testOnlyArg.setPropertyName(OPTION_LONG_TESTONLY_ARGUMENT);
    addArgument(testOnlyArg);
    cliArg = CommonArguments.getCLI();
opendj-sdk/opendj-server-legacy/src/messages/org/opends/messages/tool.properties
@@ -3038,3 +3038,5 @@
    After upgrading, see the resulting <filename>upgrade.log</filename> file       \
    for a full list of operations performed.                                       \
   </para>
INFO_ARGUMENT_DESCRIPTION_TESTONLY_20005=Just verify that the JVM can be \
 started properly