jameinel/juju — pull request #2 by jameinel (2014-06-15 11:02:46+00:00)
Title: Update all Facade implementions to call RegisterStandardFacade

This finally moves all of our existing Facades from having a helper method on srvRoot to being just registered Facade factories. It adds an 'init()' function to the Facades where they register version 0 of their Facade with the state/apiserver/common.Facades registry using the RegisterStandardFacade convenience function.

A couple of Facades had to have minor tweaks in order to conform to the RegisterStandardFacade functionality. Agent's New function didn't take a "resources" parameter, and Updater used some custom logic that got pulled out and mostly reused.

All of these init() functions have to be imported in order for them to be run, so it adds 'state/apiserver/allfacades.go' that just imports all known facades.

Pinger and Watcher facades were also just defined inline in root.go, they are now in their own watcher.go and pinger.go files.

TestDiscardedAPIMethods is replaced by the test (in previous branch) that iterates over the Facade registry and asserts that everything conforms to expectations. (no DiscardedAPIMethods on the officially registered functions), etc.