google-nomulus/javatests/google/registry
mcilwain 97c2049669 Catch errors when attempting to delete entities through Objectify
This is currently erroring out on entities that fail to load properly through Objectify (e.g. because their entity type is no longer registered).  The proper thing to do is to catch the error, log it, and fall back to the raw Datastore operation, which will succeed.

The exact Exception this is designed to catch is:

com.google.apphosting.runtime.jetty9.JettyLogger warn: /_dr/admin/deleteEntity (JettyLogger.java:29)
java.lang.IllegalStateException: No registered subclass for discriminator 'DomainApplication'
	at com.googlecode.objectify.v4.impl.PolymorphicEntityMetadata.getConcrete(PolymorphicEntityMetadata.java:133)
	at com.googlecode.objectify.v4.impl.PolymorphicEntityMetadata.load(PolymorphicEntityMetadata.java:164)
	at com.googlecode.objectify.v4.impl.LoadEngine.load(LoadEngine.java:220)
	at com.googlecode.objectify.v4.impl.LoadEngine$1.nowUncached(LoadEngine.java:178)
	at com.googlecode.objectify.v4.impl.LoadEngine$1.nowUncached(LoadEngine.java:164)
	at com.googlecode.objectify.v4.util.ResultCache.now(ResultCache.java:30)
	at com.googlecode.objectify.v4.impl.Round$1.nowUncached(Round.java:73)
	at com.googlecode.objectify.v4.util.ResultCache.now(ResultCache.java:30)
	at com.googlecode.objectify.v4.LoadResult.now(LoadResult.java:25)
	at google.registry.tools.server.DeleteEntityAction.loadOfyEntity(DeleteEntityAction.java:103)
	at google.registry.tools.server.DeleteEntityAction.run(DeleteEntityAction.java:74)

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=230737553
2019-01-24 20:02:04 -05:00
..
backup Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
batch Delete end-date sunrise, landrush, and sunrush phases 2019-01-10 16:23:35 -05:00
beam Run the Spec11 pipeline daily without sending emails 2018-12-12 13:22:34 -05:00
bigquery Use @DefaultCredential for Cloud API access in GAE 2018-09-20 11:19:36 -04:00
builddefs Format .bzl files with buildifier 2018-07-14 01:37:03 -04:00
config Configure client id and client secret in the config file 2018-12-05 16:04:08 -05:00
cron Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
dns Consolidate Dagger modules for utils classes 2019-01-17 19:20:52 -05:00
export Remove deprecated Datastore backup code 2019-01-24 19:58:54 -05:00
flows Always require acknowledgment of premium fees 2019-01-17 19:07:51 -05:00
groups Add support G-Suite group whose members have ADMIN access to registrar console 2018-11-12 14:51:40 -05:00
keyring Remove the ability to download service account credentials 2018-12-05 16:00:51 -05:00
mapreduce/inputs Delete end-date sunrise, landrush, and sunrush phases 2019-01-10 16:23:35 -05:00
model Include the premium/reserved list tests in external release 2019-01-18 17:32:15 -05:00
module Remove deprecated Datastore backup code 2019-01-24 19:58:54 -05:00
monitoring/whitebox Stop exporting EPP flow metrics to BigQuery 2018-10-08 16:59:29 -04:00
pricing Clean up third_party imports in BUILD files 2018-07-14 01:11:51 -04:00
proxy Make FOSS proxy treat connections with unknown sources more gracefully 2018-12-12 13:22:34 -05:00
rdap Statically import commonly used TldState enum values 2019-01-14 16:23:15 -05:00
rde Remove @Parameter from RdeStagingReducer 2019-01-17 19:05:50 -05:00
reporting Add diff logic and send daily Spec11 emails with new threats 2019-01-14 16:20:04 -05:00
request Add the App Engine service used in the Action definition 2019-01-17 18:59:16 -05:00
security Improve internal build system speed 2018-06-27 15:28:52 -04:00
server Add a button in the admin panel to check OT&E status of a registrar 2019-01-18 15:35:40 -05:00
storage/drive Merge JUnitBackport's expectThrows into assertThrows 2018-03-06 18:56:15 -05:00
testing Fix a few stylistic issues in preparation for Checkstyle addition 2019-01-24 19:57:14 -05:00
tldconfig/idn Remove the use of InjectRule in IdnLabelValidatorTest 2018-10-22 18:54:53 -04:00
tmch Consolidate Dagger modules for utils classes 2019-01-17 19:20:52 -05:00
tools Catch errors when attempting to delete entities through Objectify 2019-01-24 20:02:04 -05:00
ui Add a button in the admin panel to check OT&E status of a registrar 2019-01-18 15:35:40 -05:00
util Define TestRule that manages cache use in tests 2019-01-11 11:50:33 -05:00
whois Consolidate Dagger modules for utils classes 2019-01-17 19:20:52 -05:00
xjc Clean up internal imports in BUILD files 2018-07-14 01:37:03 -04:00
xml Remove unnecessary "throws" declarations 2018-06-18 18:17:56 -04:00