Repository navigation
·
39 commits
to development
since this release
Added
- Browser testing for ColdBox applications (BoxLang), built on TestBox browser support and bx-playwright: annotate any
BaseTestCasewith@browser,@browserProfileor@baseURLand it gets TestBox'sbrowse(),this.playwright(),browserAvailable()and browser matchers, while it still loads your application like any integration test.BaseTestCaseadds the ColdBox helpersrouteURL(),visitRoute()andassertRouteIs()for named routes, including module routes. Logged-in tests use bx-playwright saved sessions. Needs a TestBox release with annotation-driven browser support (Ortus-Solutions/TestBox#222). The route helpers build paths from the web root: theappMappingis not part of them, setwebMappingwhen the app is served from a sub folder. With params, a route with optional placeholders resolves to the longest variant the params fill. They throwBaseTestCase.NoColdBoxAppwhen no ColdBox application is loaded. group()now accepts ametastruct option that every route inside the group inherits. Nested groups merge outer-first and a route's ownmeta()values win on conflict. This lets a single group declare route metadata, for example the permissions consumed by security middleware.Router.registerMiddleware()registers a closure, lambda, object instance or WireBox ID under a name, singly or as a struct ofname : targetpairs, so it can be referenced frommiddleware(),group( { middleware : [ name ] } )andwithoutMiddleware( name ). Registering a name that already exists, including amiddlewareGroup()name, throwsRouter.DuplicateMiddlewareunlessforce = true. (COLDBOX-1460)
Fixed
event.route( "name@module" )built module route links without a slash between the module entry point and the route pattern- Adobe ColdFusion: a request context decorator copied the
thisreference of the original context, so its inherited methods ran against the original context and missed the decorator's own state and mocks COLDBOX-1456Bootstrap.onSessionStart()ran the session start handler on a controller that was still loading during a reinit. It now skips the event until the controller is initiated.- WireBox released a circular partner to other threads before the outer object finished wiring. A singleton, engine scope or CacheBox object built inside another build left the wiring set as soon as its own wiring ended, while holding a reference to the outer object. Keys now stay marked until the outermost build completes, tracked on the injector across all scopes.
COLDBOX-1455WireBox singleton, engine (application, session, server) and CacheBox scopes handed objects to other threads before their dependencies were wired. A single wiring lock now makes other threads wait, while the wiring thread still resolves circular dependencies.BaseTestCase.execute()(and theget(),post(), etc. helpers built on it) now runs route-scoped middleware registered withRouter.middleware(), in the same order as the Bootstrap, so integration tests exercise the same request lifecycle as a real request.- Passing a component instance as route middleware (for example
middleware( myObject )) no longer fails on engines whereisStruct()is true for components. (COLDBOX-1460)
Changed
- WireBox
CFScopesscope renamed toEngineScopes