new module:ct-services /testing /Test Service Registry Loader()
Constructs a TestServiceRegistryLoader for testing purposes.
The ServiceRegistryLoader class loads the core set of Testing
Services and stubs required for testing a blade or application. It also provides
a mechanism for replacing any implementation of a core service by invoking
module:ct-services/testing/TestServiceRegistryLoader#setService before module:ct-services/testing/TestServiceRegistryLoader#loadServices is called. Note that no
services are constructed until loadServices is invoked.
The core services include:
- caplin.services.XmlResourceService
- caplin.services.HtmlResourceService
- caplin.services.AppService
- ct-services/messaging/MessageService
- caplin.services.UserService
- caplin.services.ConnectionService
- caplin.services.security.PermissionService
Note that the default username returned by the UserService is "user".
You can change this by calling module:ct-services/testing/TestServiceRegistryLoader#setUserName (before invoking module:ct-services/testing/TestServiceRegistryLoader#loadServices.)
Extends:
Extends
Methods
add Ready Callback(fCallback)
Adds a callback that will be called after this ServiceRegistryLoader is ready. If this ServiceRegistryLoader is already ready, the callback will be called immediately.
Parameters:
| Name | Type | Description |
|---|---|---|
fCallback |
the function that should be called when this ServiceRegistryLoader is ready. |
- Inherited From:
clear Services()
Clears any services registered with this class from the ServiceRegistry.
You can continue to use this instance as long as you reinvoked {setService()} with
any services that you wish to override, followed by an invocation to {#loadServices}.
load Services()
Loads the services and registers them with the ServiceRegistry
- Inherited From:
- See:
set App Service Properties(mProperties)
Sets a set of application properties to be used for the AppService.
If there are any existing properties that have been set, they will be merged with the
specified set, with any duplicated being overridden by those in the specified set.
Parameters:
| Name | Type | Description |
|---|---|---|
mProperties |
Map | The properties to set. |
- Inherited From:
set Html Bundle Url(sUrl)
Sets the URL that will be used to load the HTML bundle.
Parameters:
| Name | Type | Description |
|---|---|---|
sUrl |
String | The URL that the bundler should use to load the HTML bundle. |
set Service(sInterface, oImplementation)
Sets the specified service interface to use the specified implementation. If there is already a service due to be registered with this interface name, it will be overridden, and only the service within this invocation will be constructed.
Parameters:
| Name | Type | Description |
|---|---|---|
sInterface |
String | The service interface to set. |
oImplementation |
Object | The implementation to set. |
- Inherited From:
set User Name(sUser Name)
Sets the username that will be returned by the UserService
Parameters:
| Name | Type | Description |
|---|---|---|
sUserName |
String | The username to return by the UserService |
- See:
-
- caplin.services.userService#getLoginName
set Xml BUndle Url(sUrl)
Sets the URL that will be used to load the XML bundle.
Parameters:
| Name | Type | Description |
|---|---|---|
sUrl |
String | The URL that the bundler should use to load the XML bundle. |