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

Jean-Noël Rouvignac
08.10.2016 78794fdcf6817de6ea4a3231d13773b0211ec6f7
Prep work for OPENDJ-1342: align APIs for DNs

Made DN.concat(RDN[]) private
2 files modified
49 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/types/DN.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java 47 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/DN.java
@@ -345,7 +345,7 @@
   * @return  A new DN that is a descendant of this DN, using the
   *          specified RDN components.
   */
  public DN concat(RDN[] rdnComponents)
  private DN concat(RDN[] rdnComponents)
  {
    RDN[] newComponents =
         new RDN[rdnComponents.length+this.rdnComponents.length];
opendj-server-legacy/src/test/java/org/opends/server/types/TestDN.java
@@ -856,53 +856,6 @@
    assertEquals(dn.child(rdn), expected);
  }
  /**
   * Test the concat(RDN...) method.
   *
   * @throws Exception
   *           If the test failed unexpectedly.
   */
  @Test(expectedExceptions = { NullPointerException.class,
      AssertionError.class })
  public void testConcatRDNException() throws Exception {
    DN dn = DN.valueOf("dc=org");
    dn.concat((RDN[]) null);
  }
  /**
   * Test the concat(RDN[]...) method.
   *
   * @param s
   *          The test DN string.
   * @param l
   *          The local name to be appended.
   * @param e
   *          The expected DN.
   * @throws Exception
   *           If the test failed unexpectedly.
   */
  @Test(dataProvider = "createConcatDNTestData")
  public void testConcatRDNSequence1(String s, String l, String e)
      throws Exception {
    DN dn = DN.valueOf(s);
    DN localName = DN.valueOf(l);
    DN expected = DN.valueOf(e);
    // Construct sequence.
    RDN[] rdns = new RDN[localName.size()];
    for (int i = 0; i < localName.size(); i++) {
      rdns[i] = localName.getRDN(i);
    }
    assertEquals(dn.concat(rdns), expected);
  }
  /**
   * Get local name test data provider.
   *