Package csw.testkit
Class AlarmTestKit
- java.lang.Object
- 
- csw.testkit.AlarmTestKit
 
- 
- All Implemented Interfaces:
- EmbeddedRedis,- RedisStore
 
 public final class AlarmTestKit extends java.lang.Object implements RedisStore AlarmTestKit supports starting Alarm server using embedded redis internally (sentinel + master) and registering it with location serviceExample: 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()
- 
- 
Constructor SummaryConstructors Constructor Description AlarmTestKit()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AlarmTestKitapply(akka.actor.typed.ActorSystem<akka.actor.typed.SpawnProtocol> actorSystem, TestKitSettings testKitSettings)Create a AlarmTestKitprotected Connection.TcpConnectionconnection()static AlarmTestKitcreate(akka.actor.typed.ActorSystem<akka.actor.typed.SpawnProtocol> actorSystem)Java API to create a EventTestKitstatic AlarmTestKitcreate(TestKitSettings testKitSettings)Java API to create a AlarmTestKitscala.concurrent.ExecutionContextec()protected java.lang.StringmasterId()akka.stream.Materializermat()voidshutdownAlarmService()Shutdown Alarm servicecsw.location.api.scaladsl.RegistrationResultstartAlarmService(int sentinelPort, int serverPort)Scala API to Start Alarm servicevoidstartAlarmService(java.util.Optional<java.lang.Object> sentinelPort, java.util.Optional<java.lang.Object> serverPort)Java API to Start Alarm serviceakka.actor.typed.ActorSystem<akka.actor.typed.SpawnProtocol>system()akka.util.Timeouttimeout()akka.actor.ActorSystemuntypedSystem()- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface csw.testkit.redis.EmbeddedRedisaddJvmShutdownHook, startSentinel, stopSentinel
 - 
Methods inherited from interface csw.testkit.redis.RedisStoreshutdown, start, start, stopRedis
 
- 
 
- 
- 
- 
Method Detail- 
applypublic static AlarmTestKit apply(akka.actor.typed.ActorSystem<akka.actor.typed.SpawnProtocol> actorSystem, TestKitSettings testKitSettings) Create a AlarmTestKitWhen the test has completed you should shutdown the alarm service with shutdownAlarmService().- Parameters:
- actorSystem- (undocumented)
- testKitSettings- (undocumented)
- Returns:
- handle to AlarmTestKit which can be used to start and stop alarm service
 
 - 
createpublic static AlarmTestKit create(akka.actor.typed.ActorSystem<akka.actor.typed.SpawnProtocol> actorSystem) Java API to create a EventTestKit- Parameters:
- actorSystem- (undocumented)
- Returns:
- handle to EventTestKit which can be used to start and stop event service
 
 - 
createpublic static AlarmTestKit create(TestKitSettings testKitSettings) Java API to create a AlarmTestKit- Parameters:
- testKitSettings- custom testKitSettings
- Returns:
- handle to AlarmTestKit which can be used to start and stop alarm service
 
 - 
untypedSystempublic akka.actor.ActorSystem untypedSystem() - Specified by:
- untypedSystemin interface- RedisStore
 
 - 
matpublic akka.stream.Materializer mat() - Specified by:
- matin interface- RedisStore
 
 - 
ecpublic scala.concurrent.ExecutionContext ec() - Specified by:
- ecin interface- RedisStore
 
 - 
systempublic akka.actor.typed.ActorSystem<akka.actor.typed.SpawnProtocol> system() - Specified by:
- systemin interface- RedisStore
 
 - 
timeoutpublic akka.util.Timeout timeout() - Specified by:
- timeoutin interface- RedisStore
 
 - 
masterIdprotected java.lang.String masterId() - Specified by:
- masterIdin interface- RedisStore
 
 - 
connectionprotected Connection.TcpConnection connection() - Specified by:
- connectionin interface- RedisStore
 
 - 
startAlarmServicepublic csw.location.api.scaladsl.RegistrationResult startAlarmService(int sentinelPort, int serverPort)Scala API to Start Alarm serviceIt will start redis sentinel and redis server on provided ports and then register's Alarm service with location service - Parameters:
- sentinelPort- (undocumented)
- serverPort- (undocumented)
- Returns:
- (undocumented)
 
 - 
startAlarmServicepublic void startAlarmService(java.util.Optional<java.lang.Object> sentinelPort, java.util.Optional<java.lang.Object> serverPort)Java API to Start Alarm serviceIt will start redis sentinel and redis server on provided ports and then register's Alarm service with location service - Parameters:
- sentinelPort- (undocumented)
- serverPort- (undocumented)
 
 - 
shutdownAlarmServicepublic void shutdownAlarmService() Shutdown Alarm serviceWhen the test has completed, make sure you shutdown Alarm service. This will terminate actor system and stop redis sentinel and redis server. 
 
- 
 
-