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

Jean-Noel Rouvignac
08.06.2015 b8c6b80da1cb6118167a934daa480eb381c59e0e
opendj-server-legacy/src/test/java/org/opends/server/replication/plugin/TopologyViewTest.java
@@ -273,7 +273,9 @@
        String serverStr = rd.getReplicationServer();
        rdPort = HostPort.valueOf(serverStr).getPort();
        if (rdPort == rsPort)
        {
          rightPort = true;
        }
      }
      if (connected && rightPort)
      {
@@ -1050,7 +1052,9 @@
    public boolean equals(Object obj)
    {
      if (obj == null || getClass() != obj.getClass())
      {
        return false;
      }
      TopoView other = (TopoView) obj;
      return checkLists(dsList, other.dsList)
          && checkLists(rsList, other.rsList);
@@ -1059,18 +1063,24 @@
    private boolean checkLists(List<?> list, List<?> otherList)
    {
      if (otherList.size() != list.size())
      {
        return false;
      }
      for (Object otherObj : otherList)
      {
        int found = 0;
        for (Object thisObj : list)
        {
          if (thisObj.equals(otherObj))
          {
            found++;
          }
        }
        // Not found
        if (found == 0)
        {
          return false;
        }
        // Should never see twice as dsInfo structure in a dsList
        assertFalse(found > 1);
      // Ok, found exactly once in the list, examine next structure