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

Matthew Swift
09.51.2011 a2435ec46d9041f48870c10d0939d8d24800653a
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/ExternalChangeLogTest.java
@@ -218,7 +218,7 @@
   * Launcher.
   */
  @Test(enabled=true)
  public void ECLReplicationServerTest()
  public void ECLReplicationServerTest() throws Exception
  {
    // No RSDomain created yet => RS only case => ECL is not a supported
    ECLIsNotASupportedSuffix();
@@ -3982,7 +3982,7 @@
   * Test ECl entry attributes, and there configuration.
   *
   */
  private void ECLIncludeAttributes()
  private void ECLIncludeAttributes() throws Exception
  {
    String tn = "ECLIncludeAttributes";
    debugInfo(tn, "Starting test\n\n");
@@ -4176,28 +4176,32 @@
          s += "Entry:" + resultEntry.toLDIFString();
          String targetdn = getAttributeValue(resultEntry, "targetdn");
          if ((targetdn.endsWith("cn=robert hue,o=test3"))
            ||(targetdn.endsWith("cn=robert hue2,o=test3")))
          {
            Entry targetEntry = parseIncludedAttributes(resultEntry,
                targetdn);
            HashSet<String> eoc = new HashSet<String>();
            eoc.add("person");eoc.add("inetOrgPerson");eoc.add("organizationalPerson");eoc.add("top");
            checkValues(resultEntry,"targetobjectclass",eoc);
            assertEquals(targetEntry.getAttributes().size(), 0); // objectClass is handled separately
            checkValues(targetEntry,"objectclass",eoc);
          }
          if (targetdn.endsWith("cn=fiona jensen,o=test2"))
          {
            checkValue(resultEntry,"targetsn","jensen");
            checkValue(resultEntry,"targetcn","Fiona Jensen");
            Entry targetEntry = parseIncludedAttributes(resultEntry,
                targetdn);
            assertEquals(targetEntry.getAttributes().size(), 2);
            checkValue(targetEntry,"sn","jensen");
            checkValue(targetEntry,"cn","Fiona Jensen");
          }
          checkValue(resultEntry,"changeinitiatorsname", "cn=Internal Client,cn=Root DNs,cn=config");
        }
      }
      assertEquals(entries.size(),8, "Entries number returned by search" + s);
    }
    catch(Exception e)
    {
      fail("Ending "+tn+" test with exception:\n"
          +  stackTraceToSingleLineString(e));
    }
    finally
    {
      try
@@ -4239,6 +4243,20 @@
    debugInfo(tn, "Ending test with success");
  }
  private Entry parseIncludedAttributes(
      SearchResultEntry resultEntry, String targetdn)
      throws Exception
  {
    // Parse includedAttributes as an entry.
    String includedAttributes = getAttributeValue(resultEntry, "includedattributes");
    String[] ldifAttributeLines = includedAttributes.split("\\n");
    String[] ldif = new String[ldifAttributeLines.length + 1];
    System.arraycopy(ldifAttributeLines, 0, ldif, 1, ldifAttributeLines.length);
    ldif[0] = "dn: " + targetdn;
    Entry targetEntry = TestCaseUtils.makeEntry(ldif);
    return targetEntry;
  }
  private void waitOpResult(AbstractOperation operation,
      ResultCode expectedResult)
  {