google-nomulus/javatests/google/registry/tools
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
..
params Remove trailing whitespace in files 2016-10-07 15:29:47 -04:00
server Centralize creation of MapreduceRunner in unit tests 2016-10-11 11:27:41 -04:00
testdata Centralize token generation and formats 2016-10-07 14:35:35 -04:00
AllocateDomainCommandTest.java Rename "clientIdentifier" to "clientId" almost everywhere 2016-09-22 14:30:05 -04:00
BUILD Add command for creating LRP tokens 2016-09-14 16:02:08 -04:00
CommandTestCase.java Add domain application create history to LrpToken 2016-08-02 19:15:31 -04:00
CreateAnchorTenantCommandTest.java Centralize token generation and formats 2016-10-07 14:35:35 -04:00
CreateContactCommandTest.java Centralize token generation and formats 2016-10-07 14:35:35 -04:00
CreateCreditBalanceCommandTest.java DeReference the codebase 2016-09-02 13:50:20 -04:00
CreateCreditCommandTest.java DeReference the codebase 2016-09-02 13:50:20 -04:00
CreateDomainCommandTest.java Centralize token generation and formats 2016-10-07 14:35:35 -04:00
CreateHostCommandTest.java Add registry_tool host_create command 2016-08-22 14:45:54 -04:00
CreateLrpTokensCommandTest.java Remove trailing whitespace in files 2016-10-07 15:29:47 -04:00
CreateOrUpdatePremiumListCommandTestCase.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
CreateOrUpdateReservedListCommandTestCase.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
CreatePremiumListCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
CreateRegistrarCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
CreateRegistrarGroupsCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
CreateReservedListCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
CreateTldCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
DeleteCreditCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
DeleteDomainCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
DeleteEntityCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
DeletePremiumListCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
DeleteReservedListCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
DomainApplicationInfoCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
DomainCheckClaimsCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
DomainCheckCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
DomainCheckFeeCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
EncryptEscrowDepositCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
EppToolCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
EppToolCommandTestCase.java Rename "clientIdentifier" to "clientId" almost everywhere 2016-09-22 14:30:05 -04:00
EppToolVerifier.java Rename "clientIdentifier" to "clientId" almost everywhere 2016-09-22 14:30:05 -04:00
ExecuteEppCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
GenerateAuctionDataCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
GenerateDnsReportCommandTest.java DeReference the codebase 2016-09-02 13:50:20 -04:00
GenerateEscrowDepositCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
GetApplicationCommandTest.java Fix confusing "now" parameters on persist deleted helper methods 2016-10-03 16:20:03 -04:00
GetApplicationIdsCommandTest.java Refactor GetEppResourceCommand hierarchy 2016-09-26 13:41:14 -04:00
GetClaimsListCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
GetContactCommandTest.java Fix confusing "now" parameters on persist deleted helper methods 2016-10-03 16:20:03 -04:00
GetDomainCommandTest.java Fix confusing "now" parameters on persist deleted helper methods 2016-10-03 16:20:03 -04:00
GetHostCommandTest.java Fix confusing "now" parameters on persist deleted helper methods 2016-10-03 16:20:03 -04:00
GetLrpTokenCommandTest.java Add command for creating LRP tokens 2016-09-14 16:02:08 -04:00
GetRegistrarCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
GetResourceByKeyCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
GetSchemaTreeCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
GetTldCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
GhostrydeCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
ListCursorsCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
ListDomainsCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
ListHostsCommandTest.java Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
ListObjectsCommandTestCase.java Always use the constructor to make Immutable Collection Builders 2016-10-07 14:37:02 -04:00
ListPremiumListsCommandTest.java Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
ListRegistrarsCommandTest.java Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
ListReservedListsCommandTest.java Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
ListTldsCommandTest.java Rename Java packages to use the .google TLD 2016-05-13 20:04:42 -04:00
MutatingCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
PublishDetailReportCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
RegistrarContactCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
RegistryToolEnvironmentTest.java Normalize expected exception handling in tests 2016-08-02 19:16:19 -04:00
RegistryToolTest.java Improve tests for RegistryTool and GtechTool 2016-10-03 15:51:08 -04:00
ResaveEnvironmentEntitiesCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
SetupOteCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
UniformRapidSuspensionCommandTest.java Rename "clientIdentifier" to "clientId" almost everywhere 2016-09-22 14:30:05 -04:00
UpdateApplicationStatusCommandTest.java Improve a few assertion fails in tests 2016-10-07 15:29:48 -04:00
UpdateClaimsNoticeCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
UpdateCursorsCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
UpdatePremiumListCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
UpdateRegistrarCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
UpdateReservedListCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
UpdateServerLocksCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
UpdateSmdCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
UpdateTldCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
UploadClaimsListCommandTest.java Move thrown.expect() right before the throwing statement 2016-10-11 11:27:54 -04:00
ValidateEscrowDepositCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00
ValidateLoginCredentialsCommandTest.java Convert entire project to strict lexicographical import sort ordering 2016-07-13 15:59:53 -04:00