AlarmTestKit

csw.testkit.AlarmTestKit
See theAlarmTestKit companion object
final class AlarmTestKit

AlarmTestKit supports starting Alarm server using embedded redis internally (sentinel + master) and registering it with location service

Example:

 private val testKit = AlarmTestKit()

 // starting alarm server (start sentinel and master on default ports specified in configuration file)
 // it will also register AlarmService with location service
 testKit.startAlarmService()

 // stopping alarm server
 testKit.shutdownAlarmService()

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

Fetches the severity of the given alarm from the alarm store

Fetches the severity of the given alarm from the alarm store

Value parameters

alarmKey

represents a unique alarm in alarm store

Attributes

Returns

the alarm severity or fails with csw.alarm.api.exceptions.KeyNotFoundException

def initAlarms(config: Config, reset: Boolean): Done

Loads data for all alarms in alarm store i.e. metadata of alarms for e.g. subsystem, component, name, etc. and status of alarms for e.g. acknowledgement status, latch status, etc.

Loads data for all alarms in alarm store i.e. metadata of alarms for e.g. subsystem, component, name, etc. and status of alarms for e.g. acknowledgement status, latch status, etc.

Value parameters

config

represents the data for all alarms to be loaded in alarm store

reset

the alarm store before loading the data

Attributes

Returns

Done when data is loaded successfully in alarm store or fails with csw.alarm.api.exceptions.ConfigParseException

See also
Note

severity of the alarm is not loaded in store and is by default inferred as Disconnected until component starts updating severity

Shutdown Alarm service

Shutdown Alarm service

When the test has completed, make sure you shutdown Alarm service. This will terminate actor system and stop redis sentinel and redis server.

Attributes

def startAlarmService(sentinelPort: Int, serverPort: Int): RegistrationResult

Scala API to Start Alarm service

Scala API to Start Alarm service

It will start redis sentinel and redis server on provided ports and then register's Alarm service with location service

Attributes

def startAlarmService(sentinelPort: Optional[Int], serverPort: Optional[Int]): Unit

Java API to Start Alarm service

Java API to Start Alarm service

It will start redis sentinel and redis server on provided ports and then register's Alarm service with location service

Attributes

Inherited methods

def shutdown(): Unit

Attributes

Inherited from:
RedisStore (hidden)
def start(sentinelPort: Optional[Int], serverPort: Optional[Int]): Unit

Attributes

Inherited from:
RedisStore (hidden)
def start(sentinelPort: Int, serverPort: Int, keyspaceEvent: Boolean): RegistrationResult

Attributes

Inherited from:
RedisStore (hidden)
def startSentinel(sentinelPort: Int, serverPort: Int, masterId: String, keyspaceEvent: Boolean): (RedisSentinel, RedisServer)

Attributes

Inherited from:
EmbeddedRedis (hidden)
def stopRedis(): Unit

Attributes

Inherited from:
RedisStore (hidden)
def stopSentinel(redisSentinel: RedisSentinel, redisServer: RedisServer): Unit

Attributes

Inherited from:
EmbeddedRedis (hidden)

Concrete fields

Implicits

Implicits

implicit override val system: ActorSystem[Command]
implicit lazy override val timeout: Timeout

Inherited implicits

implicit lazy val ec: ExecutionContext

Attributes

Inherited from:
RedisStore (hidden)
implicit lazy val untypedSystem: ActorSystem

Attributes

Inherited from:
RedisStore (hidden)