From 1a3a98c00a176a37c9fd6d0e359df2d9a1d6468c Mon Sep 17 00:00:00 2001 From: Allan Brighton Date: Tue, 7 Nov 2023 22:08:29 +0100 Subject: [PATCH] Replaced use of main App with def main(), since App doesn't work in scala 3. --- .../scala/csw/aas/installed/Example.scala | 31 ++++++------ .../src/main/scala/csw/alarm/cli/Main.scala | 34 +++++++------- .../event/CborSerializationBenchmark.scala | 31 +++++++----- .../src/main/scala/csw/config/cli/Main.scala | 26 +++++----- .../src/main/scala/csw/event/cli/Main.scala | 27 ++++++----- .../scala/example/auth/SampleHttpApp.scala | 43 ++++++++--------- .../scala/example/auth/installed/Main.scala | 23 +++++---- .../example/framework/ContainerCmdApp.scala | 8 ++-- .../example/framework/HostConfigApp.scala | 8 ++-- .../LocationServiceExampleClientApp.scala | 47 ++++++++++--------- .../LocationServiceExampleComponentApp.scala | 6 ++- .../SequencerCommandServiceExample.scala | 41 ++++++++-------- .../csw/integtration/apps/AssemblyApp.scala | 5 +- .../containercmd/sample/ContainerApp.scala | 28 ++++++----- .../containercmd/sample/ContainerCmdApp.scala | 10 ++-- 15 files changed, 196 insertions(+), 172 deletions(-) diff --git a/csw-aas/csw-aas-installed/src/test/scala/csw/aas/installed/Example.scala b/csw-aas/csw-aas-installed/src/test/scala/csw/aas/installed/Example.scala index 8df51c839d..d9dd77247d 100644 --- a/csw-aas/csw-aas-installed/src/test/scala/csw/aas/installed/Example.scala +++ b/csw-aas/csw-aas-installed/src/test/scala/csw/aas/installed/Example.scala @@ -14,26 +14,27 @@ import csw.location.client.scaladsl.HttpLocationServiceFactory import scala.concurrent.duration.DurationLong -object Example extends App { +object Example { + def main(args: Array[String]): Unit = { + implicit val actorSystem: ActorSystem[SpawnProtocol.Command] = ActorSystem(SpawnProtocol(), "test") + import actorSystem._ - private implicit val actorSystem: ActorSystem[SpawnProtocol.Command] = ActorSystem(SpawnProtocol(), "test") - import actorSystem._ + val locationService: LocationService = HttpLocationServiceFactory.makeLocalClient - val locationService: LocationService = HttpLocationServiceFactory.makeLocalClient + val installedAuthAdapter = InstalledAppAuthAdapterFactory.make(locationService, new FileAuthStore(Paths.get("/tmp/auth"))) - val installedAuthAdapter = InstalledAppAuthAdapterFactory.make(locationService, new FileAuthStore(Paths.get("/tmp/auth"))) + println("login initiated") + installedAuthAdapter.login() - println("login initiated") - installedAuthAdapter.login() + val expires: Long = installedAuthAdapter.getAccessToken().get.exp.get + println(s"Expiring on: $expires") + println(System.currentTimeMillis() / 1000) - private val expires: Long = installedAuthAdapter.getAccessToken().get.exp.get - println(s"Expiring on: $expires") - println(System.currentTimeMillis() / 1000) + val timeLeft: Long = expires - System.currentTimeMillis() / 1000 + println(s"time left to expire: $timeLeft") - private val timeLeft: Long = expires - System.currentTimeMillis() / 1000 - println(s"time left to expire: $timeLeft") + println(installedAuthAdapter.getAccessToken()) - println(installedAuthAdapter.getAccessToken()) - - println(installedAuthAdapter.getAccessToken((timeLeft + 100).seconds)) + println(installedAuthAdapter.getAccessToken((timeLeft + 100).seconds)) + } } diff --git a/csw-alarm/csw-alarm-cli/src/main/scala/csw/alarm/cli/Main.scala b/csw-alarm/csw-alarm-cli/src/main/scala/csw/alarm/cli/Main.scala index ae84a3644c..e82c6e92b7 100644 --- a/csw-alarm/csw-alarm-cli/src/main/scala/csw/alarm/cli/Main.scala +++ b/csw-alarm/csw-alarm-cli/src/main/scala/csw/alarm/cli/Main.scala @@ -10,27 +10,29 @@ import csw.alarm.cli.wiring.Wiring import csw.location.client.utils.LocationServerStatus // $COVERAGE-OFF$ -object Main extends App { +object Main { private val name: String = BuildInfo.name - new ArgsParser(name).parse(args.toList).foreach { options => - LocationServerStatus.requireUp(options.locationHost) - run(options) - } - - private def run(options: Options): Unit = { - val wiring = Wiring.make(options.locationHost) - import wiring._ - import actorRuntime._ + def main(args: Array[String]): Unit = { - try { - startLogging(name) - cliApp.execute(options) + new ArgsParser(name).parse(args.toList).foreach { options => + LocationServerStatus.requireUp(options.locationHost) + run(options) } - finally { - shutdown() + + def run(options: Options): Unit = { + val wiring = Wiring.make(options.locationHost) + import wiring._ + import actorRuntime._ + + try { + startLogging(name) + cliApp.execute(options) + } + finally { + shutdown() + } } } - } // $COVERAGE-ON$ diff --git a/csw-benchmark/src/main/scala/csw/benchmark/event/CborSerializationBenchmark.scala b/csw-benchmark/src/main/scala/csw/benchmark/event/CborSerializationBenchmark.scala index 79a6278600..d6653b396d 100644 --- a/csw-benchmark/src/main/scala/csw/benchmark/event/CborSerializationBenchmark.scala +++ b/csw-benchmark/src/main/scala/csw/benchmark/event/CborSerializationBenchmark.scala @@ -27,21 +27,26 @@ class CborSerializationBenchmark { } -object BigCborTest extends App { - val bytes: Array[Byte] = EventCbor.encode(Data.bigEvent) - val event = EventCbor.decode[SystemEvent](bytes) - assert(event == Data.bigEvent) - println(bytes.length) +object BigCborTest { + def main(args: Array[String]): Unit = { + val bytes: Array[Byte] = EventCbor.encode(Data.bigEvent) + val event = EventCbor.decode[SystemEvent](bytes) + assert(event == Data.bigEvent) + println(bytes.length) + } } -object CrossLanguageCbor extends App { - val bytes: Array[Byte] = EventCbor.encode(Data.smallEvent) +object CrossLanguageCbor { + def main(args: Array[String]): Unit = { - val bos = new BufferedOutputStream(new FileOutputStream("/tmp/input.cbor")) - bos.write(bytes) - bos.close() + val bytes: Array[Byte] = EventCbor.encode(Data.smallEvent) - val readBytes = Files.readAllBytes(Paths.get("/tmp/input.cbor")) - val event = EventCbor.decode[SystemEvent](readBytes) - println(event) + val bos = new BufferedOutputStream(new FileOutputStream("/tmp/input.cbor")) + bos.write(bytes) + bos.close() + + val readBytes = Files.readAllBytes(Paths.get("/tmp/input.cbor")) + val event = EventCbor.decode[SystemEvent](readBytes) + println(event) + } } diff --git a/csw-config/csw-config-cli/src/main/scala/csw/config/cli/Main.scala b/csw-config/csw-config-cli/src/main/scala/csw/config/cli/Main.scala index eb312a0120..45f0dc1b0d 100644 --- a/csw-config/csw-config-cli/src/main/scala/csw/config/cli/Main.scala +++ b/csw-config/csw-config-cli/src/main/scala/csw/config/cli/Main.scala @@ -12,23 +12,25 @@ import csw.logging.client.scaladsl.LoggingSystemFactory import csw.network.utils.Networks // $COVERAGE-OFF$ -object Main extends App { +object Main { private val name = BuildInfo.name - new ArgsParser(name).parse(args.toList).foreach(run) + def main(args: Array[String]): Unit = { + new ArgsParser(name).parse(args.toList).foreach(run) - private def run(options: Options): Unit = { - LocationServerStatus.requireUp(options.locationHost) + def run(options: Options): Unit = { + LocationServerStatus.requireUp(options.locationHost) - val wiring = Wiring.make(options.locationHost) - import wiring._ - LoggingSystemFactory.start(name, BuildInfo.version, Networks().hostname, actorSystem) + val wiring = Wiring.make(options.locationHost) + import wiring._ + LoggingSystemFactory.start(name, BuildInfo.version, Networks().hostname, actorSystem) - try { - cliApp.start(options) - } - finally { - actorRuntime.shutdown() + try { + cliApp.start(options) + } + finally { + actorRuntime.shutdown() + } } } } diff --git a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/Main.scala b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/Main.scala index e34bbc5265..eabc503396 100644 --- a/csw-event/csw-event-cli/src/main/scala/csw/event/cli/Main.scala +++ b/csw-event/csw-event-cli/src/main/scala/csw/event/cli/Main.scala @@ -10,22 +10,25 @@ import csw.event.cli.wiring.Wiring import csw.location.client.utils.LocationServerStatus // $COVERAGE-OFF$ -object Main extends App { +object Main { private val name = BuildInfo.name - new ArgsParser(name).parse(args.toList).foreach { options => - LocationServerStatus.requireUp(options.locationHost) - run(options) - } + def main(args: Array[String]): Unit = { + + new ArgsParser(name).parse(args.toList).foreach { options => + LocationServerStatus.requireUp(options.locationHost) + run(options) + } - private def run(options: Options): Unit = { - val wiring = Wiring.make(options.locationHost) - import wiring._ - import actorRuntime._ - startLogging(name) + def run(options: Options): Unit = { + val wiring = Wiring.make(options.locationHost) + import wiring._ + import actorRuntime._ + startLogging(name) - try cliApp.start(options) - finally actorRuntime.shutdown() + try cliApp.start(options) + finally actorRuntime.shutdown() + } } } // $COVERAGE-ON$ diff --git a/examples/src/main/scala/example/auth/SampleHttpApp.scala b/examples/src/main/scala/example/auth/SampleHttpApp.scala index 239201fbee..c015cd6338 100644 --- a/examples/src/main/scala/example/auth/SampleHttpApp.scala +++ b/examples/src/main/scala/example/auth/SampleHttpApp.scala @@ -20,29 +20,30 @@ import csw.location.client.scaladsl.HttpLocationServiceFactory import scala.concurrent.ExecutionContext // #sample-http-app -object SampleHttpApp extends App { - - implicit val actorSystem: ActorSystem[SpawnProtocol.Command] = typed.ActorSystem(SpawnProtocol(), "sample-http-app") - implicit val ec: ExecutionContext = actorSystem.executionContext - private val config = actorSystem.settings.config - - val locationService = HttpLocationServiceFactory.makeLocalClient - val directives = SecurityDirectives(config, locationService) - import directives._ - - def routes: Route = - pathPrefix("api") { - get { - complete("SUCCESS") - } ~ - sPost(RealmRolePolicy("admin")) { - complete("SUCCESS") +object SampleHttpApp { + def main(args: Array[String]): Unit = { + implicit val actorSystem: ActorSystem[SpawnProtocol.Command] = typed.ActorSystem(SpawnProtocol(), "sample-http-app") + implicit val ec: ExecutionContext = actorSystem.executionContext + val config = actorSystem.settings.config + + val locationService = HttpLocationServiceFactory.makeLocalClient + val directives = SecurityDirectives(config, locationService) + import directives._ + + def routes: Route = + pathPrefix("api") { + get { + complete("SUCCESS") + } ~ + sPost(RealmRolePolicy("admin")) { + complete("SUCCESS") + } } - } - private val host = "0.0.0.0" - private val port = 9003 + val host = "0.0.0.0" + val port = 9003 - Http().newServerAt(host, port).bind(routes) + Http().newServerAt(host, port).bind(routes) + } } // #sample-http-app diff --git a/examples/src/main/scala/example/auth/installed/Main.scala b/examples/src/main/scala/example/auth/installed/Main.scala index 9c2c355152..897721b348 100644 --- a/examples/src/main/scala/example/auth/installed/Main.scala +++ b/examples/src/main/scala/example/auth/installed/Main.scala @@ -12,21 +12,24 @@ import csw.location.client.utils.LocationServerStatus import example.auth.installed.commands.{AppCommand, CommandFactory} // #main-app -object Main extends App { +object Main { - LocationServerStatus.requireUpLocally() + def main(args: Array[String]): Unit = { - implicit val actorSystem: ActorSystem[_] = ActorSystem(Behaviors.empty, "example-system") + LocationServerStatus.requireUpLocally() - val adapter: InstalledAppAuthAdapter = AdapterFactory.makeAdapter + implicit val actorSystem: ActorSystem[_] = ActorSystem(Behaviors.empty, "example-system") - val command: Option[AppCommand] = CommandFactory.makeCommand(adapter, args) + val adapter: InstalledAppAuthAdapter = AdapterFactory.makeAdapter - try { - command.foreach(_.run()) - } - finally { - actorSystem.terminate() + val command: Option[AppCommand] = CommandFactory.makeCommand(adapter, args) + + try { + command.foreach(_.run()) + } + finally { + actorSystem.terminate() + } } } // #main-app diff --git a/examples/src/main/scala/example/framework/ContainerCmdApp.scala b/examples/src/main/scala/example/framework/ContainerCmdApp.scala index 6c57b882b8..1548b6b377 100644 --- a/examples/src/main/scala/example/framework/ContainerCmdApp.scala +++ b/examples/src/main/scala/example/framework/ContainerCmdApp.scala @@ -9,9 +9,9 @@ import csw.framework.deploy.containercmd.ContainerCmd import csw.prefix.models.Subsystem.CSW //#container-app -object ContainerCmdApp extends App { - - ContainerCmd.start("ContainerCmdApp", CSW, args) - +object ContainerCmdApp { + def main(args: Array[String]): Unit = { + ContainerCmd.start("ContainerCmdApp", CSW, args) + } } //#container-app diff --git a/examples/src/main/scala/example/framework/HostConfigApp.scala b/examples/src/main/scala/example/framework/HostConfigApp.scala index 8c2ebc4655..045a55b4c1 100644 --- a/examples/src/main/scala/example/framework/HostConfigApp.scala +++ b/examples/src/main/scala/example/framework/HostConfigApp.scala @@ -9,9 +9,9 @@ import csw.framework.deploy.hostconfig.HostConfig import csw.prefix.models.Subsystem.CSW //#host-config-app -object HostConfigApp extends App { - - HostConfig.start("HostConfigApp", CSW, args) - +object HostConfigApp { + def main(args: Array[String]): Unit = { + HostConfig.start("HostConfigApp", CSW, args) + } } //#host-config-app diff --git a/examples/src/main/scala/example/location/LocationServiceExampleClientApp.scala b/examples/src/main/scala/example/location/LocationServiceExampleClientApp.scala index 67637c54a1..09e6fc31b7 100644 --- a/examples/src/main/scala/example/location/LocationServiceExampleClientApp.scala +++ b/examples/src/main/scala/example/location/LocationServiceExampleClientApp.scala @@ -39,29 +39,30 @@ import scala.concurrent.{Await, Future} /** * An example location service client application. */ -object LocationServiceExampleClientApp extends App { - - // http location service client expect that location server is running on local machine - // here we are starting location http server so that httpLocationClient uses can be illustrated - private val wiring = new LocationServerWiring().wiring - Await.result(wiring.locationHttpService.start(), 5.seconds) - val untypedSystem = ActorSystem("untyped-system") - // #create-actor-system - val typedSystem: typed.ActorSystem[SpawnProtocol.Command] = - ActorSystemFactory.remote(SpawnProtocol(), "csw-examples-locationServiceClient") - // #create-actor-system - - // #create-location-service - private val locationService = HttpLocationServiceFactory.makeLocalClient(typedSystem) - // #create-location-service - - // #create-logging-system - private val host = InetAddress.getLocalHost.getHostName - // Only call this once per application - val loggingSystem: LoggingSystem = LoggingSystemFactory.start("LocationServiceExampleClient", "0.1", host, typedSystem) - // #create-logging-system - - untypedSystem.actorOf(LocationServiceExampleClient.props(locationService, loggingSystem)(typedSystem)) +object LocationServiceExampleClientApp { + def main(args: Array[String]): Unit = { + // http location service client expect that location server is running on local machine + // here we are starting location http server so that httpLocationClient uses can be illustrated + val wiring = new LocationServerWiring().wiring + Await.result(wiring.locationHttpService.start(), 5.seconds) + val untypedSystem = ActorSystem("untyped-system") + // #create-actor-system + val typedSystem: typed.ActorSystem[SpawnProtocol.Command] = + ActorSystemFactory.remote(SpawnProtocol(), "csw-examples-locationServiceClient") + // #create-actor-system + + // #create-location-service + val locationService = HttpLocationServiceFactory.makeLocalClient(typedSystem) + // #create-location-service + + // #create-logging-system + val host = InetAddress.getLocalHost.getHostName + // Only call this once per application + val loggingSystem: LoggingSystem = LoggingSystemFactory.start("LocationServiceExampleClient", "0.1", host, typedSystem) + // #create-logging-system + + untypedSystem.actorOf(LocationServiceExampleClient.props(locationService, loggingSystem)(typedSystem)) + } } sealed trait ExampleMessages diff --git a/examples/src/main/scala/example/location/LocationServiceExampleComponentApp.scala b/examples/src/main/scala/example/location/LocationServiceExampleComponentApp.scala index 2de007a977..ee58b9cecb 100644 --- a/examples/src/main/scala/example/location/LocationServiceExampleComponentApp.scala +++ b/examples/src/main/scala/example/location/LocationServiceExampleComponentApp.scala @@ -27,7 +27,7 @@ import scala.concurrent.{Await, ExecutionContextExecutor, Future} /** * An example that shows how to register a component actor with the location service. */ -object LocationServiceExampleComponentApp extends App { +object LocationServiceExampleComponentApp { implicit val system: typed.ActorSystem[SpawnProtocol.Command] = ActorSystemFactory.remote(SpawnProtocol(), "example-system") implicit val ec: ExecutionContextExecutor = system.executionContext private val locationService = HttpLocationServiceFactory.makeLocalClient @@ -37,7 +37,9 @@ object LocationServiceExampleComponentApp extends App { LoggingSystemFactory.start("LocationServiceExampleComponent", "0.1", host, system) // #create-logging-system - system.spawn(LocationServiceExampleComponent.behaviour(locationService), LocationServiceExampleComponent.connection.name) + def main(args: Array[String]): Unit = { + system.spawn(LocationServiceExampleComponent.behaviour(locationService), LocationServiceExampleComponent.connection.name) + } } object LocationServiceExampleComponent { diff --git a/examples/src/main/scala/example/sequencerCommandService/SequencerCommandServiceExample.scala b/examples/src/main/scala/example/sequencerCommandService/SequencerCommandServiceExample.scala index b3ed47fe70..b51497ef59 100644 --- a/examples/src/main/scala/example/sequencerCommandService/SequencerCommandServiceExample.scala +++ b/examples/src/main/scala/example/sequencerCommandService/SequencerCommandServiceExample.scala @@ -16,14 +16,12 @@ import csw.location.client.scaladsl.HttpLocationServiceFactory import csw.params.commands.CommandResponse.SubmitResponse import csw.params.commands.{CommandName, Sequence, Setup} import csw.prefix.models.{Prefix, Subsystem} -import example.sequencerCommandService.SequencerCommandServiceExample.sequencerCommandService import cps.compat.FutureAsync.* import scala.concurrent.{Await, ExecutionContextExecutor, Future} import scala.concurrent.duration.DurationLong -object SequencerCommandServiceExample extends App { - +object SequencerCommandServiceExample { implicit lazy val typedSystem: ActorSystem[SpawnProtocol.Command] = ActorSystemFactory.remote(SpawnProtocol(), "sequencer-system") implicit lazy val ec: ExecutionContextExecutor = typedSystem.executionContext @@ -39,24 +37,25 @@ object SequencerCommandServiceExample extends App { // #submit-sequence val sequence: Sequence = Sequence(Setup(Prefix("test.move"), CommandName("command-1"), None)) implicit val timeout: Timeout = Timeout(10.seconds) - async { - val initialResponse: SubmitResponse = await(sequencerCommandService.submit(sequence)) - val queryResponseF: Future[SubmitResponse] = sequencerCommandService.query(initialResponse.runId) - val queryFinalResponseF: Future[SubmitResponse] = sequencerCommandService.queryFinal(initialResponse.runId) - await(queryResponseF) - await(queryFinalResponseF) - }.map(_ => { - // do something once all is finished - }) - - // #submit-sequence - - // #submitAndWait - sequencerCommandService - .submitAndWait(sequence) - .map(finalResponse => { - // do something with finalResponse + def main(args: Array[String]): Unit = { + async { + val initialResponse: SubmitResponse = await(sequencerCommandService.submit(sequence)) + val queryResponseF: Future[SubmitResponse] = sequencerCommandService.query(initialResponse.runId) + val queryFinalResponseF: Future[SubmitResponse] = sequencerCommandService.queryFinal(initialResponse.runId) + await(queryResponseF) + await(queryFinalResponseF) + }.map(_ => { + // do something once all is finished }) - // #submitAndWait + // #submit-sequence + + // #submitAndWait + sequencerCommandService + .submitAndWait(sequence) + .map(finalResponse => { + // do something with finalResponse + }) + // #submitAndWait + } } diff --git a/integration/src/main/scala/csw/integtration/apps/AssemblyApp.scala b/integration/src/main/scala/csw/integtration/apps/AssemblyApp.scala index 186c0af8d4..93e86907d0 100644 --- a/integration/src/main/scala/csw/integtration/apps/AssemblyApp.scala +++ b/integration/src/main/scala/csw/integtration/apps/AssemblyApp.scala @@ -20,8 +20,7 @@ import csw.logging.client.commons.PekkoTypedExtension.UserActorFactory import csw.prefix.models.Prefix import csw.prefix.models.Subsystem.NFIRAOS -object AssemblyApp extends App { - +object AssemblyApp { private val locationWiring = ServerWiring.make(ClusterAwareSettings.onPort(3553).withInterface("eth1"), enableAuth = false) locationWiring.actorRuntime.startLogging("Assembly", locationWiring.clusterSettings.hostname) locationWiring.locationHttpService.start().await @@ -41,4 +40,6 @@ object AssemblyApp extends App { registrationResult.unregister() Behaviors.same } + + def main(args: Array[String]): Unit = {} } diff --git a/integration/src/multi-jvm/scala/csw/framework/containercmd/sample/ContainerApp.scala b/integration/src/multi-jvm/scala/csw/framework/containercmd/sample/ContainerApp.scala index cb5493c7a0..b57748a619 100644 --- a/integration/src/multi-jvm/scala/csw/framework/containercmd/sample/ContainerApp.scala +++ b/integration/src/multi-jvm/scala/csw/framework/containercmd/sample/ContainerApp.scala @@ -18,22 +18,24 @@ import csw.framework.internal.wiring.{Container, FrameworkWiring} import scala.concurrent.Await import scala.concurrent.duration.DurationLong -object ContainerApp extends App { - private val wiring = new FrameworkWiring() - implicit val system: ActorSystem[SpawnProtocol.Command] = wiring.actorSystem - implicit val testkit: TestKitSettings = TestKitSettings(system) - private val config: Config = ConfigFactory.load("laser_container.conf") - private val ref: ActorRef[ContainerMessage] = - Await.result(Container.spawn(config, wiring), 5.seconds) +object ContainerApp { + def main(args: Array[String]): Unit = { + val wiring = new FrameworkWiring() + implicit val system: ActorSystem[SpawnProtocol.Command] = wiring.actorSystem + implicit val testkit: TestKitSettings = TestKitSettings(system) + val config: Config = ConfigFactory.load("laser_container.conf") + val ref: ActorRef[ContainerMessage] = + Await.result(Container.spawn(config, wiring), 5.seconds) - Thread.sleep(2000) + Thread.sleep(2000) - ref ! Restart + ref ! Restart - Thread.sleep(2000) + Thread.sleep(2000) - private val containerLifecycleStateProbe: TestProbe[ContainerLifecycleState] = TestProbe[ContainerLifecycleState]() - ref ! GetContainerLifecycleState(containerLifecycleStateProbe.ref) + val containerLifecycleStateProbe: TestProbe[ContainerLifecycleState] = TestProbe[ContainerLifecycleState]() + ref ! GetContainerLifecycleState(containerLifecycleStateProbe.ref) - containerLifecycleStateProbe.expectMessage(ContainerLifecycleState.Running) + containerLifecycleStateProbe.expectMessage(ContainerLifecycleState.Running) + } } diff --git a/integration/src/multi-jvm/scala/csw/framework/containercmd/sample/ContainerCmdApp.scala b/integration/src/multi-jvm/scala/csw/framework/containercmd/sample/ContainerCmdApp.scala index 44073e73f7..8021a58aaa 100644 --- a/integration/src/multi-jvm/scala/csw/framework/containercmd/sample/ContainerCmdApp.scala +++ b/integration/src/multi-jvm/scala/csw/framework/containercmd/sample/ContainerCmdApp.scala @@ -9,8 +9,10 @@ import csw.framework.deploy.containercmd.ContainerCmd import csw.prefix.models.Subsystem.CSW // DEOPSCSW-171: Starting component from command line -object ContainerCmdApp extends App { - // name which will appear in log statements as `@componentName` - val componentName = "Sample-App" - ContainerCmd.start(componentName, CSW, args) +object ContainerCmdApp { + def main(args: Array[String]): Unit = { + // name which will appear in log statements as `@componentName` + val componentName = "Sample-App" + ContainerCmd.start(componentName, CSW, args) + } }