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

Chris Ridd
01.19.2013 f41aab0eb9b8fc42c1caea3a15434c000234c26a
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/AttrInfoTest.java
@@ -23,12 +23,10 @@
 *
 *
 *      Copyright 2006-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2013 ForgeRock, AS.
 */
package org.opends.server.replication.plugin;
import java.util.HashMap;
import java.util.Map;
import java.util.ArrayList;
import org.opends.server.core.DirectoryServer;
import org.opends.server.replication.ReplicationTestCase;
@@ -91,15 +89,15 @@
    // Check add(AttributeValue val, ChangeNumber CN)
    attrInfo1.add(att, updateTime);
    Map<AttrValueHistorical,AttrValueHistorical> values1 = attrInfo1.getValuesHistorical();
    ArrayList<AttrValueHistorical> values1 = attrInfo1.getValuesHistorical();
    assertTrue(values1.size() == 1);
    AttrValueHistorical valueInfo1 = new AttrValueHistorical(att, updateTime, null);
    assertTrue(values1.containsKey(valueInfo1));
    assertTrue(values1.get(0).equals(valueInfo1));
    // Check constructor with parameter
    AttrValueHistorical valueInfo2 = new AttrValueHistorical(att, updateTime, deleteTime);
    HashMap<AttrValueHistorical,AttrValueHistorical> values = new HashMap<AttrValueHistorical,AttrValueHistorical>();
    values.put(valueInfo2, valueInfo2);
    ArrayList<AttrValueHistorical> values = new ArrayList<AttrValueHistorical>();
    values.add(valueInfo2);
    AttrHistoricalMultiple attrInfo2 = new AttrHistoricalMultiple(deleteTime, updateTime, values);
    // Check equality
@@ -108,14 +106,14 @@
    //  Check constructor with time parameter and not Value
    AttrHistoricalMultiple attrInfo3 = new AttrHistoricalMultiple(deleteTime, updateTime, null);
    attrInfo3.add(att, updateTime);
    Map<AttrValueHistorical,AttrValueHistorical> values3 = attrInfo3.getValuesHistorical();
    ArrayList<AttrValueHistorical> values3 = attrInfo3.getValuesHistorical();
    assertTrue(values3.size() == 1);
    valueInfo1 = new AttrValueHistorical(att, updateTime, null);
    assertTrue(values3.containsKey(valueInfo1));
    assertTrue(values3.get(0).equals(valueInfo1));
    // Check duplicate
    AttrHistoricalMultiple attrInfo4 = attrInfo3.duplicate();
    Map<AttrValueHistorical,AttrValueHistorical> values4 = attrInfo4.getValuesHistorical();
    ArrayList<AttrValueHistorical> values4 = attrInfo4.getValuesHistorical();
    assertTrue(attrInfo4.getDeleteTime().compareTo(attrInfo3.getDeleteTime())==0);
    assertEquals(values4.size(), values3.size());