Clone
Dan Haywood <dan@haywood-associates.co.uk>
committed
on 24 Mar 16
ISIS-1342: IsisSystem no longer throws MetaModelException, instead pushes it onto the IsisContext. Its callers (IsisWicketApplication, or I… Show more
ISIS-1342: IsisSystem no longer throws MetaModelException, instead pushes it onto the IsisContext.  Its callers (IsisWicketApplication, or IsisSessionFilter - for RO - or CukeGlueAbstract, or IsisSystemForTest) then expose the error appropriately, accessing from IsisContext.

Additional details:

- IsisSystem no longer initializes the AuthenticationManager, AuthorizationManager or PersistenceSessionFactory if there was a metamodel validation, to minimize impact on runtime.

- IsisSystemForTest will fail with a minimal error for any subsequent tests

- IsisContext now as new metamodeInvalidException field.  This is static rather than held on the IsisContext instance as a threadlocal; that's because IsisSystemForTest actually calls IsisContext.testReset() to discard the IsisContext singleton.

- IsisSessionFilter (which sits in front of RO viewer) now always checks that the metamodel is vaild.  It does this simply by querying the IsisContext.  (If WebAppBootstrapper was used to bootstrap, rather than wicket viewer, then IsisSystem.init() is still called so no diff in end result)

- ScenarioException simply does a fail() if no instance available on threadlocal.

- CukeGlueAbstract similarly has simple guards for if ScenarioException available, to reduce amount of noise when problem is metamodel invalid

- formatting changes only for IsisWicketApplication

- WebRequestCycleForIsis looks for validation errors first-off in its onException handler, if any are found then immediately redirects to the MmvErrorPage.  This seems to work fine for always rendering MMV page.

Improvements:

- IsisMojoAbstract keeps the IsisSystem initialized while it executes.

Show less

master + 32 more