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

Matthew Swift
04.06.2013 99d61d666d09a86ecb98ee17e0138543592a04f8
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
commit99d61d666d09a86ecb98ee17e0138543592a04f8
tree 5e2a517d5367c0d42d72e9f92551a5288aa13e44 tree | zip | gz
parent 220fd1221d0ca64b083d383bf02adedd1da7f415 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
opendj-sdk/opends/src/server/org/opends/server/replication/plugin/LDAPReplicationDomain.java 6 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationBroker.java 107 ●●●● diff | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/replication/service/ReplicationDomain.java 39 ●●●●● diff | view | raw | blame | history