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

Yannick Lecaillez
11.52.2016 11e4c53175413bc0fb64cef0409c207aca20e7c5
Fix build issues from OPENDJ-3230-3223 fix.
2 files modified
36 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeImporter.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/OnDiskMergeImporterTest.java 34 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/OnDiskMergeImporter.java
@@ -516,7 +516,7 @@
      {
        // Name could be a (attributeType)((.indexType)|(.matchingRule))
        // Add a trailing "." to ensure that resulting parts has always at least two parts.
        final String parts[] = (name + ".").split("\\.");
        final String parts[] = (name + ".*").split("\\.");
        // Is name represents all VLV index ?
        final SelectIndexName selector = new SelectIndexName();
opendj-server-legacy/src/test/java/org/opends/server/backends/pluggable/OnDiskMergeImporterTest.java
@@ -199,34 +199,46 @@
    };
  }
  @Test(dataProvider="expandIndexData")
  @Test(dataProvider = "expandIndexData")
  public void testCanExpandIndexNames(final String[] indexNames, final String[] expectedExpandedIndexNames)
      throws InitializationException {
      throws InitializationException
  {
    final StrategyImpl strategy = new StrategyImpl(serverContext, backend.getRootContainer(), backendCfg);
    assertThat(strategy.expandIndexNames(entryContainer, asList(indexNames)))
      .containsExactlyInAnyOrder(expectedExpandedIndexNames);
  }
  @Test(expectedExceptions=InitializationException.class)
  public void testThrowOnUnindexedType() throws InitializationException {
  @Test
  public void testIgnoreUnindexedType() throws InitializationException
  {
    final StrategyImpl strategy = new StrategyImpl(serverContext, backend.getRootContainer(), backendCfg);
    strategy.expandIndexNames(entryContainer, asList(".approximate"));
    assertThat(strategy.expandIndexNames(entryContainer, asList(".approximate"))).isEmpty();
  }
  @Test(expectedExceptions=InitializationException.class)
  public void testThrowOnUnrecognizedMatchingRule() throws InitializationException {
  @Test
  public void testIgnoreUnindexedMatchingRule() throws InitializationException
  {
    final StrategyImpl strategy = new StrategyImpl(serverContext, backend.getRootContainer(), backendCfg);
    assertThat(strategy.expandIndexNames(entryContainer, asList(".IntegerFirstComponentMatch"))).isEmpty();
  }
  @Test(expectedExceptions = InitializationException.class)
  public void testThrowOnUnrecognizedSecondPart() throws InitializationException
  {
    final StrategyImpl strategy = new StrategyImpl(serverContext, backend.getRootContainer(), backendCfg);
    strategy.expandIndexNames(entryContainer, asList(".unknown"));
  }
  @Test(expectedExceptions=InitializationException.class)
  public void testThrowOnUnrecognizedAttribute() throws InitializationException {
  @Test(expectedExceptions = InitializationException.class)
  public void testThrowOnUnrecognizedAttributeType() throws InitializationException
  {
    final StrategyImpl strategy = new StrategyImpl(serverContext, backend.getRootContainer(), backendCfg);
    strategy.expandIndexNames(entryContainer, asList("unknown"));
  }
  @Test(expectedExceptions=InitializationException.class)
  public void testThrowOnUnrecognizedVlvIndex() throws InitializationException {
  @Test(expectedExceptions = InitializationException.class)
  public void testThrowOnUnrecognizedVlvIndex() throws InitializationException
  {
    final StrategyImpl strategy = new StrategyImpl(serverContext, backend.getRootContainer(), backendCfg);
    strategy.expandIndexNames(entryContainer, asList("vlv.unknown"));
  }