google-nomulus/javatests/google/registry
cgoldfeder f3a0b78145 Move thrown.expect() right before the throwing statement
aka regexing for fun and profit.

This also makes sure that there are no statements after the
throwing statement, since these would be dead code. There
were a surprising number of places with assertions after
the throw, and none of these are actually triggered in tests
ever. When I found these, I replaced them with try/catch/rethrow
which makes the assertions actually happen:

before:

// This is the ExceptionRule that checks EppException marshaling
thrown.expect(FooException.class);
doThrowingThing();
assertSomething();  // Dead code!

after:

try {
  doThrowingThing();
  assertWithMessage("...").fail();
} catch (FooException e) {
  assertSomething();
  // For EppExceptions:
  assertAboutEppExceptins().that(e).marshalsToXml();
}

To make this work, I added EppExceptionSubject.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=135793407
2016-10-11 11:27:54 -04:00
..
backup Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
batch Centralize creation of MapreduceRunner in unit tests 2016-10-11 11:27:41 -04:00
bigquery Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
builddefs Create zip_file() rule 2016-08-02 19:17:55 -04:00
config Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
cron Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
dns Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
export Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
flows Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
groups Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
mapreduce/inputs Replace loadByUniqueId() with methods that don't overload unique id 2016-09-26 13:20:22 -04:00
model Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
module Wire in MetricsReporter to FrontendServlet 2016-09-07 11:52:59 -04:00
monitoring Improve a few assertion fails in tests 2016-10-07 15:29:48 -04:00
pricing Add extra logic for all relevant flows 2016-09-14 15:26:36 -04:00
rdap RDAP: Display truncation notice for large entity result sets 2016-10-07 15:29:49 -04:00
rde Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
request Remove unused request parameter extractor 2016-08-22 14:24:44 -04:00
security Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
server DeReference the codebase 2016-09-02 13:50:20 -04:00
storage/drive Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
testing Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
tldconfig/idn Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
tmch Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
tools Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
ui Make product name driven from config in the console 2016-10-07 15:29:48 -04:00
util Improve pretty-print diffing of Datastore entities 2016-09-19 12:06:54 -04:00
whois Improve a few assertion fails in tests 2016-10-07 15:29:48 -04:00
xjc Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
xml Remove trailing whitespace in files 2016-10-07 15:29:47 -04:00