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

matthew_swift
17.05.2007 f42bb1f095f0b3eac12684f5f0794ae5d61a9db5
opends/src/server/org/opends/server/admin/BooleanPropertyDefinition.java
@@ -52,19 +52,9 @@
  static {
    VALUE_MAP = new HashMap<String, Boolean>();
    VALUE_MAP.put("0", Boolean.FALSE);
    VALUE_MAP.put("no", Boolean.FALSE);
    VALUE_MAP.put("off", Boolean.FALSE);
    // We could have more possibilities but decided against in issue 1960.
    VALUE_MAP.put("false", Boolean.FALSE);
    VALUE_MAP.put("disable", Boolean.FALSE);
    VALUE_MAP.put("disabled", Boolean.FALSE);
    VALUE_MAP.put("1", Boolean.TRUE);
    VALUE_MAP.put("yes", Boolean.TRUE);
    VALUE_MAP.put("on", Boolean.TRUE);
    VALUE_MAP.put("true", Boolean.TRUE);
    VALUE_MAP.put("enable", Boolean.TRUE);
    VALUE_MAP.put("enabled", Boolean.TRUE);
  }
opends/src/server/org/opends/server/admin/PropertyDefinitionUsageBuilder.java
@@ -83,7 +83,11 @@
     */
    @Override
    public String visitBoolean(BooleanPropertyDefinition d, Void p) {
      return "BOOLEAN";
      if (isDetailed) {
        return "false | true";
      } else {
        return "BOOLEAN";
      }
    }
opends/tests/unit-tests-testng/src/server/org/opends/server/admin/BooleanPropertyDefinitionTest.java
@@ -29,6 +29,7 @@
import static org.testng.Assert.*;
import org.opends.server.TestCaseUtils;
import org.opends.server.admin.std.meta.RootCfgDefn;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
@@ -42,10 +43,17 @@
  BooleanPropertyDefinition.Builder builder = null;
  /**
   * Sets up tests
   * Sets up tests.
   *
   * @throws Exception
   *           If the server could not be initialized.
   */
  @BeforeClass
  public void setUp() {
  public void setUp() throws Exception {
    // This test suite depends on having the schema available, so
    // we'll start the server.
    TestCaseUtils.startServer();
    builder = BooleanPropertyDefinition.createBuilder(
        RootCfgDefn.getInstance(), "test-property");
  }
@@ -74,18 +82,8 @@
  @DataProvider(name = "testDecodeValueData")
  public Object[][] createvalidateValueData() {
    return new Object[][]{
            {"0", Boolean.FALSE},
            {"no", Boolean.FALSE},
            {"off", Boolean.FALSE},
            {"false", Boolean.FALSE},
            {"disable", Boolean.FALSE},
            {"disabled", Boolean.FALSE},
            {"1", Boolean.TRUE},
            {"yes", Boolean.TRUE},
            {"on", Boolean.TRUE},
            {"true", Boolean.TRUE},
            {"enable", Boolean.TRUE},
            {"enabled", Boolean.TRUE},
            {"true", Boolean.TRUE}
    };
  }