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

Gaetan Boismal
30.17.2015 640ba03f9a7e7584f53711ce9a95606ff444110f
OPENDJ-2493 Make JE Backend default

JE Backend is the default choice on setup.
This is fix by sorted configuration element by their names.
Also add a unit test to ensure that JE is the default backend.
1 files added
2 files modified
49 ■■■■■ changed files
opendj-config/src/main/java/org/forgerock/opendj/config/AbstractManagedObjectDefinition.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/admin/AbstractManagedObjectDefinition.java 5 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/tools/BackendTypeHelperTestCase.java 41 ●●●●● patch | view | raw | blame | history
opendj-config/src/main/java/org/forgerock/opendj/config/AbstractManagedObjectDefinition.java
@@ -38,6 +38,7 @@
import java.util.Map;
import java.util.MissingResourceException;
import java.util.Set;
import java.util.TreeMap;
import java.util.Vector;
import org.forgerock.i18n.LocalizableMessage;
@@ -104,7 +105,7 @@
    private final Set<ManagedObjectOption> options = EnumSet.noneOf(ManagedObjectOption.class);
    /** The set of managed object definitions which inherit from this definition. */
    private final Map<String, AbstractManagedObjectDefinition<? extends C, ? extends S>> children = new HashMap<>();
    private final Map<String, AbstractManagedObjectDefinition<? extends C, ? extends S>> children = new TreeMap<>();
    /**
     * Create a new abstract managed object definition.
opendj-server-legacy/src/main/java/org/opends/server/admin/AbstractManagedObjectDefinition.java
@@ -42,6 +42,7 @@
import java.util.MissingResourceException;
import java.util.Set;
import java.util.TreeMap;
import java.util.Vector;
import org.forgerock.i18n.LocalizableMessage;
import org.opends.server.admin.DefinitionDecodingException.Reason;
@@ -135,8 +136,7 @@
  private final Set<ManagedObjectOption> options;
  /** The set of managed object definitions which inherit from this definition. */
  private final Map<String,
    AbstractManagedObjectDefinition<? extends C, ? extends S>> children;
  private final Map<String, AbstractManagedObjectDefinition<? extends C, ? extends S>> children = new TreeMap<>();
@@ -166,7 +166,6 @@
    this.allAggregationPropertyDefinitions = new HashMap<>();
    this.allTags = new HashSet<>();
    this.options = EnumSet.noneOf(ManagedObjectOption.class);
    this.children = new HashMap<>();
    // If we have a parent definition then inherit its features.
    if (parent != null) {
opendj-server-legacy/src/test/java/org/opends/server/tools/BackendTypeHelperTestCase.java
New file
@@ -0,0 +1,41 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
 * or http://forgerock.org/license/CDDLv1.0.html.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at legal-notices/CDDLv1_0.txt.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2015 ForgeRock AS.
 */
package org.opends.server.tools;
import static org.assertj.core.api.Assertions.assertThat;
import org.forgerock.opendj.server.config.meta.JEBackendCfgDefn;
import org.testng.annotations.Test;
@SuppressWarnings("javadoc")
public class BackendTypeHelperTestCase extends ToolsTestCase
{
  @Test
  public void testJEBackendIsDefault()
  {
    assertThat(new BackendTypeHelper().getBackendTypes().get(0)).isInstanceOf(JEBackendCfgDefn.class);
  }
}