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

Matthew Swift
04.06.2013 d74313cd4989848ab8cb3106a22cc1c8378cde58
refs
author Matthew Swift <matthew.swift@forgerock.com>
Tuesday, June 4, 2013 22:06 +0200
committer Matthew Swift <matthew.swift@forgerock.com>
Tuesday, June 4, 2013 22:06 +0200
commitd74313cd4989848ab8cb3106a22cc1c8378cde58
tree cbbf4a34053176d3d1ca3656f38f12da76821d10 tree | zip | gz
parent f5248e0848f7a9b907c00311d3a44690565a4486 view | diff
Fix unit test regression introduced in previous fix for OPENDJ-866 (Local RS is named differently).

This commit addresses the InternalSearchMonitorTestCase unit test regression introduced by my previous fix for OPENDJ-866.

Monitor provider instance names are required to be stable so that deregistration attempts succeed. This is not the case for many of our replication monitors which include mutable components such as host addresses or connected RS identifiers (as a parent RDN). Before my fix for OPENDJ-866 these "mutating" monitors took care to re-register themselves whenever they detected that the name was about to change. Unfortunately my fix for OPENDJ-866 made the names of local replica monitors mutable as well by including the local address. The side effect was that the monitor providers would sometimes not be deregistered which was causing the org.opends.server.monitors.InternalSearchMonitorTestCase unit test to fail.

This fix modifies the replication domain monitor provider so that it re-registers itself whenever it senses a potential name change (i.e. connection establishment). The change was not as simple as I hoped because many unit tests create replication brokers with null replication domains.

I've refactored the code a little and pushed ownership of the monitor provider into the broker in order to make its lifecycle clearer.
3 files modified
152 ■■■■■ changed files
opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java 6 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/service/ReplicationBroker.java 107 ●●●● diff | view | raw | blame | history
opends/src/server/org/opends/server/replication/service/ReplicationDomain.java 39 ●●●●● diff | view | raw | blame | history