FrameworkTestKit

csw.testkit.FrameworkTestKit
See theFrameworkTestKit companion object
final class FrameworkTestKit

FrameworkTestKit supports starting one or more services from csw.testkit.scaladsl.CSWService It also provides helpers to spawn components in standalone or container mode

Example:

 private val testKit = FrameworkTestKit()

 // this will start Event and Alarm Server (Note: Location Server will always be started as it is required by all other services)
 testKit.start(EventServer, AlarmServer)

 // spawn component in standalone mode
 testKit.spawnStandalone(ConfigFactory.load("standalone.conf"))

 // stopping services
 testKit.shutdown()

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def shutdown(): Unit

Shutdown all testkits which are started.

Shutdown all testkits which are started.

Attributes

def spawnAssembly(prefix: Prefix, behaviorFactory: (ActorContext[TopLevelActorMessage], CswContext) => ComponentHandlers, locationServiceUsage: LocationServiceUsage, connections: Set[Connection], initializeTimeout: FiniteDuration): ActorRef[ComponentMessage]

Use this to start assembly in standalone mode

Use this to start assembly in standalone mode

Value parameters

behaviorFactory

behavior factory for the assembly

connections

connections to track for the assembly

initializeTimeout

initialize timeout for the assembly

locationServiceUsage

location service usages of the assembly

prefix

prefix of the assembly

Attributes

Returns

actorRef of spawned assembly

Note

before calling this, make sure you have started location server and other pre-requisite services use one of [FrameworkTestKit#startAll] or [FrameworkTestKit#start] method to start services

def spawnContainer(config: Config): ActorRef[ContainerMessage]

Use this to start multiple components in container mode

Use this to start multiple components in container mode

Value parameters

config

configuration of container

Attributes

Returns

actorRef of spawned container

Note

before calling this, make sure you have started location server and other pre-requisite services use one of [FrameworkTestKit#startAll] or [FrameworkTestKit#start] method to start services

def spawnHCD(prefix: Prefix, behaviorFactory: (ActorContext[TopLevelActorMessage], CswContext) => ComponentHandlers, locationServiceUsage: LocationServiceUsage, connections: Set[Connection], initializeTimeout: FiniteDuration): ActorRef[ComponentMessage]

Use this to start hcd in standalone mode

Use this to start hcd in standalone mode

Value parameters

behaviorFactory

behavior factory for the hcd

connections

connections to track for the hcd

initializeTimeout

initialize timeout for the hcd

locationServiceUsage

location service usages of the hcd

prefix

prefix of the hcd

Attributes

Returns

actorRef of spawned hcd

Note

before calling this, make sure you have started location server and other pre-requisite services use one of [FrameworkTestKit#startAll] or [FrameworkTestKit#start] method to start services

def spawnStandalone(config: Config): ActorRef[ComponentMessage]

Use this to start component in standalone mode

Use this to start component in standalone mode

Value parameters

config

configuration of standalone component

Attributes

Returns

actorRef of spawned standalone component (supervisor)

Note

before calling this, make sure you have started location server and other pre-requisite services use one of [FrameworkTestKit#startAll] or [FrameworkTestKit#start] method to start services

def start(services: CSWService*): Unit

Before running tests, use this or [FrameworkTestKit#startAll] method to start required services

Before running tests, use this or [FrameworkTestKit#startAll] method to start required services

This will always start location server as it is required by all other services along with provided services

Attributes

def startAll(): Unit

Before running tests, use this or [FrameworkTestKit#start] method to start required services

Before running tests, use this or [FrameworkTestKit#start] method to start required services

This will start following services: [LocationServer, ConfigServer, EventServer, AlarmServer]

Attributes

Implicits

Implicits

implicit lazy val actorSystem: ActorSystem[Command]
implicit lazy val ec: ExecutionContext