Skip to content

Commit

Permalink
Updated dependencies and syntax for scala-3.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
abrighton committed May 30, 2024
1 parent a676eeb commit 2ed4513
Show file tree
Hide file tree
Showing 169 changed files with 498 additions and 457 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ class ArgsParser(name: String) {
.children(
cmd("get")
.action((_, args) => args.copy(subCmd = "get"))
.children(optionalAlarmKey: _*)
.children(optionalAlarmKey*)
.text("get severity of a subsystem/component/alarm"),
cmd("set")
.action((_, args) => args.copy(subCmd = "set"))
.children(requiredAlarmKey :+ severity :+ refresh: _*)
.children(requiredAlarmKey :+ severity :+ refresh*)
.text("set severity of an alarm"),
cmd("subscribe")
.action((_, args) => args.copy(subCmd = "subscribe"))
.children(optionalAlarmKey: _*)
.children(optionalAlarmKey*)
.text("subscribe to severity of a subsystem/component/alarm")
)

Expand All @@ -41,53 +41,53 @@ class ArgsParser(name: String) {
.children(
cmd("get")
.action((_, args) => args.copy(subCmd = "get"))
.children(optionalAlarmKey: _*)
.children(optionalAlarmKey*)
.text("get health of a subsystem/component/alarm"),
cmd("subscribe")
.action((_, args) => args.copy(subCmd = "subscribe"))
.children(optionalAlarmKey: _*)
.children(optionalAlarmKey*)
.text("subscribe to health of a subsystem/component/alarm")
)

cmd("acknowledge")
.action((_, args) => args.copy(cmd = "acknowledge"))
.text("acknowledge an alarm")
.children(requiredAlarmKey: _*)
.children(requiredAlarmKey*)

cmd("unacknowledge")
.action((_, args) => args.copy(cmd = "unacknowledge"))
.text("unacknowledge an alarm")
.children(requiredAlarmKey: _*)
.children(requiredAlarmKey*)

cmd("activate")
.action((_, args) => args.copy(cmd = "activate"))
.text("activate an alarm")
.children(requiredAlarmKey: _*)
.children(requiredAlarmKey*)

cmd("deactivate")
.action((_, args) => args.copy(cmd = "deactivate"))
.text("deactivate an alarm")
.children(requiredAlarmKey: _*)
.children(requiredAlarmKey*)

cmd("shelve")
.action((_, args) => args.copy(cmd = "shelve"))
.text("shelve an alarm")
.children(requiredAlarmKey: _*)
.children(requiredAlarmKey*)

cmd("unshelve")
.action((_, args) => args.copy(cmd = "unshelve"))
.text("unshelve an alarm")
.children(requiredAlarmKey: _*)
.children(requiredAlarmKey*)

cmd("reset")
.action((_, args) => args.copy(cmd = "reset"))
.text("reset latched severity of an alarm")
.children(requiredAlarmKey: _*)
.children(requiredAlarmKey*)

cmd("list")
.action((_, args) => args.copy(cmd = "list"))
.text("list alarms")
.children(optionalAlarmKey :+ metadata :+ status: _*)
.children(optionalAlarmKey :+ metadata :+ status*)

opt[String]("locationHost") action { (x, c) =>
c.copy(locationHost = x)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ trait AlarmCliTestSetup extends HTTPLocationService with EmbeddedRedis with Even
val argsParser = new ArgsParser(BuildInfo.name)
val logBuffer: mutable.Buffer[String] = mutable.Buffer.empty[String]

var redisSentinel: RedisSentinel = _
var redisServer: RedisServer = _
var redisSentinel: RedisSentinel = scala.compiletime.uninitialized
var redisServer: RedisServer = scala.compiletime.uninitialized

private def printLine(msg: Any): Unit = logBuffer += msg.toString

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication {
val cmd = Options("list")

cliApp.execute(cmd)
logBuffer.toList shouldEqualContentsOf "list/all_alarms.txt"
logBuffer.toList `shouldEqualContentsOf` "list/all_alarms.txt"
}

// DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms)
Expand All @@ -241,7 +241,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication {
val cmd = Options("list", maybeSubsystem = Some(NFIRAOS))

cliApp.execute(cmd)
logBuffer.toList shouldEqualContentsOf "list/subsystem_alarms.txt"
logBuffer.toList `shouldEqualContentsOf` "list/subsystem_alarms.txt"
}

// DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms)
Expand All @@ -254,7 +254,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication {
)

cliApp.execute(cmd)
logBuffer.toList shouldEqualContentsOf "list/component_alarms.txt"
logBuffer.toList `shouldEqualContentsOf` "list/component_alarms.txt"
}

// DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms)
Expand All @@ -268,7 +268,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication {
)

cliApp.execute(cmd)
logBuffer.toList shouldEqualContentsOf "list/with_name_alarms.txt"
logBuffer.toList `shouldEqualContentsOf` "list/with_name_alarms.txt"
}

// DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms)
Expand All @@ -283,7 +283,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication {
)

cliApp.execute(cmd)
logBuffer.toList shouldEqualContentsOf "metadata.txt"
logBuffer.toList `shouldEqualContentsOf` "metadata.txt"
}

// DEOPSCSW-492: Fetch all alarms' metadata from CLI Interface (list all alarms)
Expand All @@ -300,7 +300,7 @@ class CliAppTest extends AlarmCliTestSetup with MockedAuthentication {

cliApp.execute(cmd)
// alarm time changes on every run hence filter out time before assertion
logBuffer.toList shouldEqualContentsOf "status.txt"
logBuffer.toList `shouldEqualContentsOf` "status.txt"

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) {
* @param system an actor system required for underlying actors
* @return an instance of [[csw.alarm.api.scaladsl.AlarmAdminService]]
*/
def makeAdminApi(locationService: LocationService)(implicit system: ActorSystem[_]): AlarmAdminService = {
def makeAdminApi(locationService: LocationService)(implicit system: ActorSystem[?]): AlarmAdminService = {
implicit val ec: ExecutionContext = system.executionContext
alarmService(new AlarmServiceLocationResolver(locationService))
}
Expand All @@ -56,7 +56,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) {
* @param system an actor system required for underlying actors
* @return an instance of [[csw.alarm.api.scaladsl.AlarmAdminService]]
*/
def makeAdminApi(host: String, port: Int)(implicit system: ActorSystem[_]): AlarmAdminService = {
def makeAdminApi(host: String, port: Int)(implicit system: ActorSystem[?]): AlarmAdminService = {
implicit val ec: ExecutionContext = system.executionContext
alarmService(new AlarmServiceHostPortResolver(host, port))
}
Expand All @@ -68,7 +68,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) {
* @param system an actor system required for underlying actors
* @return an instance of [[csw.alarm.api.scaladsl.AlarmService]]
*/
def makeClientApi(locationService: LocationService)(implicit system: ActorSystem[_]): AlarmService =
def makeClientApi(locationService: LocationService)(implicit system: ActorSystem[?]): AlarmService =
makeAdminApi(locationService)

/**
Expand All @@ -79,7 +79,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) {
* @param system an actor system required for underlying actors
* @return an instance of [[csw.alarm.api.scaladsl.AlarmService]]
*/
def makeClientApi(host: String, port: Int)(implicit system: ActorSystem[_]): AlarmService = makeAdminApi(host, port)
def makeClientApi(host: String, port: Int)(implicit system: ActorSystem[?]): AlarmService = makeAdminApi(host, port)

/**
* Creates [[csw.alarm.api.javadsl.IAlarmService]] instance for non admin users using [[csw.location.api.javadsl.ILocationService]]
Expand All @@ -88,7 +88,7 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) {
* @param system an actor system required for underlying actors
* @return an instance of [[csw.alarm.api.javadsl.IAlarmService]]
*/
def jMakeClientApi(locationService: ILocationService, system: ActorSystem[_]): IAlarmService =
def jMakeClientApi(locationService: ILocationService, system: ActorSystem[?]): IAlarmService =
new JAlarmServiceImpl(makeAdminApi(locationService.asScala)(system))

/**
Expand All @@ -99,20 +99,20 @@ class AlarmServiceFactory(redisClient: RedisClient = RedisClient.create()) {
* @param system an actor system required for underlying actors
* @return an instance of [[csw.alarm.api.javadsl.IAlarmService]]
*/
def jMakeClientApi(host: String, port: Int, system: ActorSystem[_]): IAlarmService =
def jMakeClientApi(host: String, port: Int, system: ActorSystem[?]): IAlarmService =
new JAlarmServiceImpl(makeAdminApi(host, port)(system))

/**
* ********** INTERNAL ***********
*/
private def alarmService(alarmServiceResolver: AlarmServiceResolver)(implicit system: ActorSystem[_], ec: ExecutionContext) = {
private def alarmService(alarmServiceResolver: AlarmServiceResolver)(implicit system: ActorSystem[?], ec: ExecutionContext) = {
val settings = new Settings(ConfigFactory.load())
val redisConnectionsFactory =
new RedisConnectionsFactory(alarmServiceResolver, settings.masterId, new RomaineFactory(redisClient))
new AlarmServiceImpl(redisConnectionsFactory, settings)
}

private[alarm] def makeAlarmImpl(locationService: LocationService)(implicit system: ActorSystem[_]) = {
private[alarm] def makeAlarmImpl(locationService: LocationService)(implicit system: ActorSystem[?]) = {
implicit val ec: ExecutionContext = system.executionContext
alarmService(new AlarmServiceLocationResolver(locationService))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ private[alarm] class AlarmServiceImpl(
override val redisConnectionsFactory: RedisConnectionsFactory,
override val settings: Settings
)(implicit
override val actorSystem: typed.ActorSystem[_],
override val actorSystem: typed.ActorSystem[?],
val ec: ExecutionContext
) extends AlarmAdminService
with MetadataServiceModule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ private[client] trait HealthServiceModule extends HealthService {
self: SeverityService =>

val redisConnectionsFactory: RedisConnectionsFactory
implicit val actorSystem: typed.ActorSystem[_]
implicit val actorSystem: typed.ActorSystem[?]
import redisConnectionsFactory._

private val log = AlarmServiceLogger.getLogger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import cps.compat.FutureAsync.*
import scala.concurrent.Future

private[client] trait SeverityServiceModule extends SeverityService {
self: MetadataService with StatusService =>
self: MetadataService & StatusService =>

val redisConnectionsFactory: RedisConnectionsFactory
def settings: Settings
implicit val actorSystem: typed.ActorSystem[_]
implicit val actorSystem: typed.ActorSystem[?]
import redisConnectionsFactory._

private val log = AlarmServiceLogger.getLogger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import csw.prefix.models.Prefix
import csw.prefix.models.Subsystem.AOESW

trait TestDataFeeder {
self: SeverityServiceModule with MetadataServiceModule with StatusServiceModule =>
self: SeverityServiceModule & MetadataServiceModule & StatusServiceModule =>

def feedTestData(testCase: SetSeverityTestCase): Unit =
feedTestData(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ sealed abstract class Key private[alarm] (subsystem: String, component: String,
case null => false
case _ =>
val x = that.asInstanceOf[AnyRef]
(x eq this.asInstanceOf[AnyRef]) || (x eq self.asInstanceOf[AnyRef]) || (x equals self)
(x eq this.asInstanceOf[AnyRef]) || (x eq self.asInstanceOf[AnyRef]) || (x `equals` self)
}
override def toString: String = "" + self
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ import scala.concurrent.duration.DurationInt
@Measurement(iterations = 10, time = 1, timeUnit = TimeUnit.SECONDS, batchSize = 1)
class CommandServiceBenchmark {

implicit var timeout: util.Timeout = _
implicit var scheduler: Scheduler = _
var setupCommand: commands.Setup = _
var componentRef: CommandService = _
private var adminWiring: ServerWiring = _
implicit var timeout: util.Timeout = scala.compiletime.uninitialized
implicit var scheduler: Scheduler = scala.compiletime.uninitialized
var setupCommand: commands.Setup = scala.compiletime.uninitialized
var componentRef: CommandService = scala.compiletime.uninitialized
private var adminWiring: ServerWiring = scala.compiletime.uninitialized

@Setup(Level.Trial)
def setup(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ object Data {
private val arrayDataKey = KeyType.IntArrayKey.make("intarrays")
private val matrixDataKey = KeyType.IntMatrixKey.make("intmatrices")

private val paramSet: Set[Parameter[_]] = Set(
private val paramSet: Set[Parameter[?]] = Set(
byteKey.set(100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100),
intKey.set(100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100),
doubleKey.set(100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342, 100.342,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ import scala.concurrent.duration.DurationLong
// DEOPSCSW-279: Test logging performance
@State(Scope.Benchmark)
class E2ELoggingBenchmark {
var actorSystem: typed.ActorSystem[SpawnProtocol.Command] = _
var log: Logger = _
var fileAppender: FileAppender = _
var person: Person = _
var actorSystem: typed.ActorSystem[SpawnProtocol.Command] = scala.compiletime.uninitialized
var log: Logger = scala.compiletime.uninitialized
var fileAppender: FileAppender = scala.compiletime.uninitialized
var person: Person = scala.compiletime.uninitialized

@Setup(Level.Trial)
def setup(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ import scala.concurrent.duration.DurationLong
// DEOPSCSW-279: Test logging performance
@State(Scope.Benchmark)
class FileAppenderBenchmark {
var actorSystem: typed.ActorSystem[SpawnProtocol.Command] = _
var fileAppender: FileAppender = _
var actorSystem: typed.ActorSystem[SpawnProtocol.Command] = scala.compiletime.uninitialized
var fileAppender: FileAppender = scala.compiletime.uninitialized

@Setup(Level.Trial)
def setup(): Unit = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ class JsonUtilBenchmark {

val expectedLogMsgJson1: JsObject = Json.parse(logMsgString1).as[JsObject]

var gson: Gson = _
var jacksonObjectMapper: ObjectMapper = _
var gson: Gson = scala.compiletime.uninitialized
var jacksonObjectMapper: ObjectMapper = scala.compiletime.uninitialized

@Setup(Level.Trial)
def setup() = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ import scala.concurrent.duration.DurationDouble
// DEOPSCSW-331: Complex payload - Include byte in paramset for Event and ObserveEvent
@State(Scope.Benchmark)
class ImageDeSerializationBenchmark {
private final var system: ActorSystem[_] = _
private final var serialization: Serialization = _
private final var prefixStr: String = _
private final var obsId: ObsId = _
private final var system: ActorSystem[?] = scala.compiletime.uninitialized
private final var serialization: Serialization = scala.compiletime.uninitialized
private final var prefixStr: String = scala.compiletime.uninitialized
private final var obsId: ObsId = scala.compiletime.uninitialized

private final var img_32k_tuple: (Array[Byte], Observe) = _
private final var img_128k_tuple: (Array[Byte], Observe) = _
private final var img_512k_tuple: (Array[Byte], Observe) = _
private final var img_32k_tuple: (Array[Byte], Observe) = scala.compiletime.uninitialized
private final var img_128k_tuple: (Array[Byte], Observe) = scala.compiletime.uninitialized
private final var img_512k_tuple: (Array[Byte], Observe) = scala.compiletime.uninitialized

@Setup(Level.Trial)
def setup(): Unit = {
Expand All @@ -71,7 +71,7 @@ class ImageDeSerializationBenchmark {
val imageKey: Key[ArrayData[Byte]] = ByteArrayKey.make("imageKey")

val binaryImgData: ArrayData[Byte] = ArrayData.fromArray(binaryData)
val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData withUnits pascal
val param: Parameter[ArrayData[Byte]] = imageKey -> binaryImgData `withUnits` pascal

val observe = Observe(Prefix("csw.originationPrefix"), CommandName(prefixStr), Some(obsId)).add(param)
val observeSerializer = serialization.findSerializerFor(observe)
Expand Down
Loading

0 comments on commit 2ed4513

Please sign in to comment.