mirror of
https://github.com/google/nomulus.git
synced 2025-05-08 07:48:21 +02:00
Here's an alternate approach that I think simplifies the existing code quite a bit. Now instead of doing: RegistryToolEnvironment.loadFromArgs(args); RegistryToolEnvironment.get().setup(); You just do one chained call: RegistryToolEnvironment.parseFromArgs(args).setup(); or call setup() on a known environment constant: RegistryToolEnvironment.ALPHA.setup(); This avoids having loadFromArgs() implicitly set the active env (but *not* do setup) and then having setup() *not* set the active env, both of which were confusing. Now parseFromArgs() is only responsible for parsing from args, and setup() both sets the env as the active one and does the environment variable setup (which also ensures that the RegistryToolEnvironment.instance field doesn't get out of sync with the RegistryEnvironment value). In addition, this CL adds a runCommandInEnvironment() method to CommandTestCase and ensures that the UNITTEST environment is always set before constructing the default command instance. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=117492978 |
||
---|---|---|
.. | ||