google-nomulus/java/com/google/domain/registry
nickfelt 5174c1c63f Improve RegistryToolEnvironment setup behavior
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
2016-03-23 22:38:08 -04:00
..
backup Import code from internal repository to git 2016-03-01 17:59:16 -05:00
bigquery Give core registry libraries public visibility 2016-03-04 16:20:50 -05:00
braintree Give core registry libraries public visibility 2016-03-04 16:20:50 -05:00
config Rename Runnable classes from Tasks to Actions 2016-03-16 21:20:25 -04:00
cron Import code from internal repository to git 2016-03-01 17:59:16 -05:00
dns Rename Runnable classes from Tasks to Actions 2016-03-16 21:20:25 -04:00
eclipse Eclipse file generation script 2016-03-09 12:26:47 -08:00
env Remove EppResource.SharedFields following successful data migration 2016-03-23 22:38:08 -04:00
export Set # of reducer shards on ExportDomainLists [] 2016-03-23 22:38:08 -04:00
flows Break out EppResourceInput subclasses 2016-03-16 21:20:25 -04:00
gcs Give core registry libraries public visibility 2016-03-04 16:20:50 -05:00
groups Import code from internal repository to git 2016-03-01 17:59:16 -05:00
idn Import code from internal repository to git 2016-03-01 17:59:16 -05:00
keyring/api Rename Runnable classes from Tasks to Actions 2016-03-16 21:20:25 -04:00
loadtest Rename Runnable classes from Tasks to Actions 2016-03-16 21:20:25 -04:00
mapreduce Delete duplicate MR inputs files 2016-03-16 21:20:25 -04:00
model Remove EppResource.SharedFields following successful data migration 2016-03-23 22:38:08 -04:00
module Annihilate the annihilator [] 2016-03-16 21:20:25 -04:00
monitoring/whitebox Import code from internal repository to git 2016-03-01 17:59:16 -05:00
rdap Removes fixed TODO 2016-03-16 21:20:25 -04:00
rde Break out EppResourceInput subclasses 2016-03-16 21:20:25 -04:00
request Give core registry libraries public visibility 2016-03-04 16:20:50 -05:00
security Give core registry libraries public visibility 2016-03-04 16:20:50 -05:00
storage/drive Import code from internal repository to git 2016-03-01 17:59:16 -05:00
tldconfig/idn Import code from internal repository to git 2016-03-01 17:59:16 -05:00
tmch Rename Runnable classes from Tasks to Actions 2016-03-16 21:20:25 -04:00
tools Improve RegistryToolEnvironment setup behavior 2016-03-23 22:38:08 -04:00
ui Rename Runnable classes from Tasks to Actions 2016-03-16 21:20:25 -04:00
util Drop unnecessary typecast in CidrAddressBlock 2016-03-16 21:20:25 -04:00
whois Make additional targets publicly visible 2016-03-08 11:12:25 -08:00
xjc Import code from internal repository to git 2016-03-01 17:59:16 -05:00
xml Import code from internal repository to git 2016-03-01 17:59:16 -05:00
BUILD Import code from internal repository to git 2016-03-01 17:59:16 -05:00
repositories.bzl Fix copyright header on repositories.bzl 2016-03-10 16:48:39 -05:00