Descriptionstate;api: Implement RelationUnitsWatcher in API
This implements the last needed bit in the server-side
uniter API: RelationUnitsWatcher. There are a few steps
needed before the actual implementation:
1. Move RelationUnitsChange and UnitSettings from
state to params.
2. Unexport the concrete state.RelationUnitsWatcher
and define a RelationUnitsWatcher as interface, as
with the other watchers.
3. Implement state/testing/RelationUnitsWatcherC.
Finally, UniterAPI.WatchRelationUnits() as implemented.
A few drive-by fixes were done as well:
1. Changed state/testing/watcher.go's gocheck import
and imports order to match the other files.
2. Replaced state/relationunit_test.go's local asserts
with the statetesting's RelationUnitsWatcherC's ones.
3. Added a test in RelationUnitsWatcherC.AssertChange
a check to ensure unit settings versions always increase
on a change (we're not checking their exact values in
other tests becasue they're volatile; we just check the
Changed field of the RelationUnitsChange contains what
we expected).
In a follow-up, the client-side API RelationUnitsWatcher
will be implemented.
https://code.launchpad.net/~dimitern/juju-core/119-apiserver-relationunitswatcher/+merge/183856
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 4
Patch Set 2 : state;api: Implement RelationUnitsWatcher in API #
Total comments: 4
Patch Set 3 : state;api: Implement RelationUnitsWatcher in API #
MessagesTotal messages: 5
|