Class
caplin.services.testing

TestServiceRegistryLoader

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 #setService() before #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
  • caplin.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 #setUserName (before invoking #loadServices.)

Constructor Summary

Attributes Name and Description
caplin.services.testing.TestServiceRegistryLoader()

Constructs a TestServiceRegistryLoader for testing purposes.

Method Summary

Attributes Name and Description
void clearServices()

Clears any services registered with this class from the ServiceRegistry.

void setHtmlBundleUrl(String sUrl)

Sets the URL that will be used to load the HTML bundle.

void setUserName(String sUserName)

Sets the username that will be returned by the UserService

void setXmlBUndleUrl(String sUrl)

Sets the URL that will be used to load the XML bundle.

Methods inherited from class caplin.services.ServiceRegistryLoader:
addReadyCallback, loadServices, setAppServiceProperties, setService

Constructor Detail

caplin.services.testing.TestServiceRegistryLoader()

Constructs a TestServiceRegistryLoader for testing purposes.

Method Detail

void clearServices()

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}.

void setHtmlBundleUrl(String sUrl)

Sets the URL that will be used to load the HTML bundle.

Parameters
String sUrl The URL that the bundler should use to load the HTML bundle.

void setUserName(String sUserName)

Sets the username that will be returned by the UserService

Parameters
String sUserName The username to return by the UserService
See
caplin.services.userService#getLoginName()

void setXmlBUndleUrl(String sUrl)

Sets the URL that will be used to load the XML bundle.

Parameters
String sUrl The URL that the bundler should use to load the XML bundle.