diff --git a/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala b/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala index 4feef3e01f..24a6c6193e 100644 --- a/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/event/LoggerSpec.scala @@ -170,7 +170,7 @@ class LoggerSpec extends WordSpec with Matchers { out.size should be > (0) } - "drain logger queue on system shutdown" in { + "drain logger queue on system.terminate" in { val out = new java.io.ByteArrayOutputStream() Console.withOut(out) { val sys = ActorSystem("defaultLogger", slowConfig) diff --git a/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala b/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala index dabf890aeb..5a73f23c8d 100644 --- a/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/io/TcpConnectionSpec.scala @@ -402,7 +402,7 @@ class TcpConnectionSpec extends AkkaSpec(""" connectionHandler.expectMsgType[Received].data.decodeString("ASCII") should ===(vs) } - finally system.shutdown() + finally system.terminate() } "close the connection and reply with `Closed` upon reception of a `Close` command" in diff --git a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala index b088dd9bff..111cdfd18b 100644 --- a/akka-actor/src/main/scala/akka/actor/ActorSystem.scala +++ b/akka-actor/src/main/scala/akka/actor/ActorSystem.scala @@ -491,7 +491,7 @@ abstract class ExtendedActorSystem extends ActorSystem { /** * Create an actor in the "/system" namespace. This actor will be shut down - * during system shutdown only after all user actors have terminated. + * during system.terminate only after all user actors have terminated. */ def systemActorOf(props: Props, name: String): ActorRef diff --git a/akka-bench-jmh/src/main/scala/akka/http/HttpBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/http/HttpBenchmark.scala index 1d23a3fe0f..dfe19990b7 100644 --- a/akka-bench-jmh/src/main/scala/akka/http/HttpBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/http/HttpBenchmark.scala @@ -56,7 +56,7 @@ class HttpBenchmark { def shutdown() = { Await.ready(Http().shutdownAllConnectionPools(), 1.second) binding.unbind() - system.shutdown() + system.terminate() system.awaitTermination() } diff --git a/akka-bench-jmh/src/main/scala/akka/stream/FlatMapMergeBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/stream/FlatMapMergeBenchmark.scala index f6eef9c24e..8c36e39fbf 100644 --- a/akka-bench-jmh/src/main/scala/akka/stream/FlatMapMergeBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/stream/FlatMapMergeBenchmark.scala @@ -44,7 +44,7 @@ class FlatMapMergeBenchmark { @TearDown def shutdown() { - system.shutdown() + system.terminate() system.awaitTermination() } diff --git a/akka-bench-jmh/src/main/scala/akka/stream/FlowMapBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/stream/FlowMapBenchmark.scala index 272937d6f5..4bf5cd3df8 100644 --- a/akka-bench-jmh/src/main/scala/akka/stream/FlowMapBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/stream/FlowMapBenchmark.scala @@ -110,7 +110,7 @@ class FlowMapBenchmark { @TearDown def shutdown() { - system.shutdown() + system.terminate() system.awaitTermination() } diff --git a/akka-bench-jmh/src/main/scala/akka/stream/MaterializationBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/stream/MaterializationBenchmark.scala index 08cf0cf9ee..4b4df25ba5 100644 --- a/akka-bench-jmh/src/main/scala/akka/stream/MaterializationBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/stream/MaterializationBenchmark.scala @@ -97,7 +97,7 @@ class MaterializationBenchmark { @TearDown def shutdown() { - system.shutdown() + system.terminate() system.awaitTermination() } diff --git a/akka-bench-jmh/src/main/scala/akka/stream/io/FileSourcesBenchmark.scala b/akka-bench-jmh/src/main/scala/akka/stream/io/FileSourcesBenchmark.scala index 5067338e59..961985ad25 100644 --- a/akka-bench-jmh/src/main/scala/akka/stream/io/FileSourcesBenchmark.scala +++ b/akka-bench-jmh/src/main/scala/akka/stream/io/FileSourcesBenchmark.scala @@ -64,7 +64,7 @@ class FileSourcesBenchmark { @TearDown def shutdown() { - system.shutdown() + system.terminate() system.awaitTermination() } diff --git a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala index eb7ba075c8..1a9a7b5529 100644 --- a/akka-cluster/src/main/scala/akka/cluster/Cluster.scala +++ b/akka-cluster/src/main/scala/akka/cluster/Cluster.scala @@ -340,7 +340,7 @@ class Cluster(val system: ExtendedActorSystem) extends Extension { /** * The supplied thunk will be run, once, when current cluster member is `Removed`. * If the cluster has already been shutdown the thunk will run on the caller thread immediately. - * Typically used together `cluster.leave(cluster.selfAddress)` and then `system.shutdown()`. + * Typically used together `cluster.leave(cluster.selfAddress)` and then `system.terminate()`. */ def registerOnMemberRemoved[T](code: ⇒ T): Unit = registerOnMemberRemoved(new Runnable { override def run(): Unit = code }) @@ -348,7 +348,7 @@ class Cluster(val system: ExtendedActorSystem) extends Extension { /** * Java API: The supplied thunk will be run, once, when current cluster member is `Removed`. * If the cluster has already been shutdown the thunk will run on the caller thread immediately. - * Typically used together `cluster.leave(cluster.selfAddress)` and then `system.shutdown()`. + * Typically used together `cluster.leave(cluster.selfAddress)` and then `system.terminate()`. */ def registerOnMemberRemoved(callback: Runnable): Unit = { if (_isTerminated.get()) diff --git a/akka-docs/rst/java/code/docs/actor/ActorDocTest.java b/akka-docs/rst/java/code/docs/actor/ActorDocTest.java index 206072f7b4..ca021910fb 100644 --- a/akka-docs/rst/java/code/docs/actor/ActorDocTest.java +++ b/akka-docs/rst/java/code/docs/actor/ActorDocTest.java @@ -64,7 +64,7 @@ public class ActorDocTest { @AfterClass public static void afterClass() { - system.shutdown(); + system.terminate(); system.awaitTermination(Duration.create("5 seconds")); } @@ -314,7 +314,7 @@ public class ActorDocTest { swapper.tell(Swap, ActorRef.noSender()); // logs Ho swapper.tell(Swap, ActorRef.noSender()); // logs Hi swapper.tell(Swap, ActorRef.noSender()); // logs Ho - system.shutdown(); + system.terminate(); } } //#swapper diff --git a/akka-docs/rst/java/code/docs/actor/InitializationDocTest.java b/akka-docs/rst/java/code/docs/actor/InitializationDocTest.java index 67c22748b8..e1735839f8 100644 --- a/akka-docs/rst/java/code/docs/actor/InitializationDocTest.java +++ b/akka-docs/rst/java/code/docs/actor/InitializationDocTest.java @@ -27,7 +27,7 @@ public class InitializationDocTest { @AfterClass public static void afterClass() { - system.shutdown(); + system.terminate(); system.awaitTermination(Duration.create("5 seconds")); } diff --git a/akka-docs/rst/java/code/docs/http/javadsl/server/HighLevelServerBindFailureExample.java b/akka-docs/rst/java/code/docs/http/javadsl/server/HighLevelServerBindFailureExample.java index 475fa1d8d6..7b0a750a74 100644 --- a/akka-docs/rst/java/code/docs/http/javadsl/server/HighLevelServerBindFailureExample.java +++ b/akka-docs/rst/java/code/docs/http/javadsl/server/HighLevelServerBindFailureExample.java @@ -29,11 +29,11 @@ public class HighLevelServerBindFailureExample { @Override public void onFailure(Throwable failure) throws Throwable { System.err.println("Something very bad happened! " + failure.getMessage()); - system.shutdown(); + system.terminate(); } }, system.dispatcher()); - system.shutdown(); + system.terminate(); } } //#binding-failure-high-level-example diff --git a/akka-docs/rst/java/code/docs/http/javadsl/server/HighLevelServerExample.java b/akka-docs/rst/java/code/docs/http/javadsl/server/HighLevelServerExample.java index f59547cb23..43f5914b0b 100644 --- a/akka-docs/rst/java/code/docs/http/javadsl/server/HighLevelServerExample.java +++ b/akka-docs/rst/java/code/docs/http/javadsl/server/HighLevelServerExample.java @@ -22,7 +22,7 @@ public class HighLevelServerExample extends HttpApp { new HighLevelServerExample().bindRoute("localhost", 8080, system); System.out.println("Type RETURN to exit"); System.in.read(); - system.shutdown(); + system.terminate(); } // A RequestVal is a type-safe representation of some aspect of the request. diff --git a/akka-docs/rst/java/code/docs/http/javadsl/server/HttpServerExampleDocTest.java b/akka-docs/rst/java/code/docs/http/javadsl/server/HttpServerExampleDocTest.java index dc25bd9e8a..c737b21095 100644 --- a/akka-docs/rst/java/code/docs/http/javadsl/server/HttpServerExampleDocTest.java +++ b/akka-docs/rst/java/code/docs/http/javadsl/server/HttpServerExampleDocTest.java @@ -237,7 +237,7 @@ public class HttpServerExampleDocTest { System.out.println("Press ENTER to stop."); new BufferedReader(new InputStreamReader(System.in)).readLine(); } finally { - system.shutdown(); + system.terminate(); } } public static void main(String[] args) throws Exception { diff --git a/akka-docs/rst/java/code/docs/http/javadsl/server/WebsocketCoreExample.java b/akka-docs/rst/java/code/docs/http/javadsl/server/WebsocketCoreExample.java index ad94233675..97c1499c82 100644 --- a/akka-docs/rst/java/code/docs/http/javadsl/server/WebsocketCoreExample.java +++ b/akka-docs/rst/java/code/docs/http/javadsl/server/WebsocketCoreExample.java @@ -63,7 +63,7 @@ public class WebsocketCoreExample { System.out.println("Press ENTER to stop."); new BufferedReader(new InputStreamReader(System.in)).readLine(); } finally { - system.shutdown(); + system.terminate(); } } diff --git a/akka-docs/rst/scala/code/docs/akka/typed/IntroSpec.scala b/akka-docs/rst/scala/code/docs/akka/typed/IntroSpec.scala index f819f51189..ae8938b301 100644 --- a/akka-docs/rst/scala/code/docs/akka/typed/IntroSpec.scala +++ b/akka-docs/rst/scala/code/docs/akka/typed/IntroSpec.scala @@ -78,7 +78,7 @@ class IntroSpec extends TypedSpec { def `must say hello`(): Unit = { //#hello-world import HelloWorld._ - // using global pool since we want to run tasks after system shutdown + // using global pool since we want to run tasks after system.terminate import scala.concurrent.ExecutionContext.Implicits.global val system: ActorSystem[Greet] = ActorSystem("hello", Props(greeter)) diff --git a/akka-docs/rst/scala/code/docs/http/scaladsl/HttpServerExampleSpec.scala b/akka-docs/rst/scala/code/docs/http/scaladsl/HttpServerExampleSpec.scala index e677ecb5dc..d05ae4e484 100644 --- a/akka-docs/rst/scala/code/docs/http/scaladsl/HttpServerExampleSpec.scala +++ b/akka-docs/rst/scala/code/docs/http/scaladsl/HttpServerExampleSpec.scala @@ -281,7 +281,7 @@ class HttpServerExampleSpec extends WordSpec with Matchers { Console.readLine() // for the future transformations bindingFuture .flatMap(_.unbind()) // trigger unbinding from the port - .onComplete(_ ⇒ system.shutdown()) // and shutdown when done + .onComplete(_ ⇒ system.terminate()) // and shutdown when done } } diff --git a/akka-docs/rst/scala/code/docs/http/scaladsl/server/WebsocketExampleSpec.scala b/akka-docs/rst/scala/code/docs/http/scaladsl/server/WebsocketExampleSpec.scala index d2fc0cab49..49934db185 100644 --- a/akka-docs/rst/scala/code/docs/http/scaladsl/server/WebsocketExampleSpec.scala +++ b/akka-docs/rst/scala/code/docs/http/scaladsl/server/WebsocketExampleSpec.scala @@ -62,7 +62,7 @@ class WebsocketExampleSpec extends WordSpec with Matchers { import system.dispatcher // for the future transformations bindingFuture .flatMap(_.unbind()) // trigger unbinding from the port - .onComplete(_ ⇒ system.shutdown()) // and shutdown when done + .onComplete(_ ⇒ system.terminate()) // and shutdown when done } "routing-example" in { pending // compile-time only test @@ -104,6 +104,6 @@ class WebsocketExampleSpec extends WordSpec with Matchers { import system.dispatcher // for the future transformations bindingFuture .flatMap(_.unbind()) // trigger unbinding from the port - .onComplete(_ ⇒ system.shutdown()) // and shutdown when done + .onComplete(_ ⇒ system.terminate()) // and shutdown when done } } diff --git a/akka-http-core/src/test/java/akka/http/javadsl/WSEchoTestClientApp.java b/akka-http-core/src/test/java/akka/http/javadsl/WSEchoTestClientApp.java index f04afac3e2..c7650c8466 100644 --- a/akka-http-core/src/test/java/akka/http/javadsl/WSEchoTestClientApp.java +++ b/akka-http-core/src/test/java/akka/http/javadsl/WSEchoTestClientApp.java @@ -77,7 +77,7 @@ public class WSEchoTestClientApp { for (String msg: messages) System.out.println(msg); } finally { - system.shutdown(); + system.terminate(); } } } diff --git a/akka-http-core/src/test/java/akka/http/javadsl/model/JavaTestServer.java b/akka-http-core/src/test/java/akka/http/javadsl/model/JavaTestServer.java index 6137bec5af..caaaa5654e 100644 --- a/akka-http-core/src/test/java/akka/http/javadsl/model/JavaTestServer.java +++ b/akka-http-core/src/test/java/akka/http/javadsl/model/JavaTestServer.java @@ -51,7 +51,7 @@ public class JavaTestServer { System.out.println("Press ENTER to stop."); new BufferedReader(new InputStreamReader(System.in)).readLine(); } finally { - system.shutdown(); + system.terminate(); } } diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/client/HttpConfigurationSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/client/HttpConfigurationSpec.scala index fb8699ebc9..354caf9802 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/client/HttpConfigurationSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/client/HttpConfigurationSpec.scala @@ -135,7 +135,7 @@ class HttpConfigurationSpec extends AkkaSpec { val config = ConfigFactory.parseString(overrides).withFallback(ConfigFactory.load()) // we go via ActorSystem in order to hit the settings caching infrastructure val sys = ActorSystem("config-testing", config) - try block(sys) finally sys.shutdown() + try block(sys) finally sys.terminate() } } \ No newline at end of file diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/HttpHeaderParserSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/HttpHeaderParserSpec.scala index 6e11c02852..6425656459 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/HttpHeaderParserSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/HttpHeaderParserSpec.scala @@ -228,7 +228,7 @@ class HttpHeaderParserSpec extends WordSpec with Matchers with BeforeAndAfterAll } } - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() def check(pair: (String, String)) = { val (expected, actual) = pair diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/HttpHeaderParserTestBed.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/HttpHeaderParserTestBed.scala index 448c946f96..c951412441 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/HttpHeaderParserTestBed.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/HttpHeaderParserTestBed.scala @@ -30,5 +30,5 @@ object HttpHeaderParserTestBed extends App { """.stripMargin.replace("%TRIE%", parser.formatTrie) } - system.shutdown() + system.terminate() } diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/RequestParserSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/RequestParserSpec.scala index 9480c8f1a0..1f27ae45b0 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/RequestParserSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/RequestParserSpec.scala @@ -435,7 +435,7 @@ class RequestParserSpec extends FreeSpec with Matchers with BeforeAndAfterAll { } } - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() private class Test { def awaitAtMost: FiniteDuration = 250.millis diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/ResponseParserSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/ResponseParserSpec.scala index a60b99a84a..915aa535f5 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/ResponseParserSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/parsing/ResponseParserSpec.scala @@ -240,7 +240,7 @@ class ResponseParserSpec extends FreeSpec with Matchers with BeforeAndAfterAll { } } - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() private class Test { var closeAfterResponseCompletion = Seq.empty[Boolean] diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/RequestRendererSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/RequestRendererSpec.scala index 06cc0f6c66..584f1f4c81 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/RequestRendererSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/RequestRendererSpec.scala @@ -316,7 +316,7 @@ class RequestRendererSpec extends FreeSpec with Matchers with BeforeAndAfterAll } } - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() class TestSetup(val userAgent: Option[`User-Agent`] = Some(`User-Agent`("akka-http/1.0.0")), serverAddress: InetSocketAddress = new InetSocketAddress("test.com", 8080)) diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/ResponseRendererSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/ResponseRendererSpec.scala index 41c6aac340..734e6a5ac4 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/ResponseRendererSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/rendering/ResponseRendererSpec.scala @@ -577,7 +577,7 @@ class ResponseRendererSpec extends FreeSpec with Matchers with BeforeAndAfterAll } } - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() class TestSetup(val serverHeader: Option[Server] = Some(Server("akka-http/1.0.0"))) extends HttpResponseRendererFactory(serverHeader, responseHeaderSizeHint = 64, NoLogging) { diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/EchoTestClientApp.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/EchoTestClientApp.scala index ec4b95d3b3..edddaeadc6 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/EchoTestClientApp.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/EchoTestClientApp.scala @@ -59,12 +59,12 @@ object EchoTestClientApp extends App { case Success(res) ⇒ println("Run successful. Got these elements:") res.foreach(println) - system.shutdown() + system.terminate() case Failure(e) ⇒ println("Run failed.") e.printStackTrace() - system.shutdown() + system.terminate() } - system.scheduler.scheduleOnce(10.seconds)(system.shutdown()) + system.scheduler.scheduleOnce(10.seconds)(system.terminate()) } diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WSClientAutobahnTest.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WSClientAutobahnTest.scala index 50a42e90c3..a3eac1ae93 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WSClientAutobahnTest.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WSClientAutobahnTest.scala @@ -159,12 +159,12 @@ object WSClientAutobahnTest extends App { def updateReportsAndShutdown(): Unit = updateReports().onComplete { res ⇒ println("Reports should now be accessible at http://localhost:8080/cwd/reports/clients/index.html") - system.shutdown() + system.terminate() } import scala.concurrent.duration._ import system.dispatcher - system.scheduler.scheduleOnce(60.seconds)(system.shutdown()) + system.scheduler.scheduleOnce(60.seconds)(system.terminate()) def runWs[T](uri: Uri, clientFlow: Flow[Message, Message, T]): T = Http().singleWebsocketRequest(uri, clientFlow)._2 diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WSServerAutobahnTest.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WSServerAutobahnTest.scala index 5a76df6da3..e2ca57b0c7 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WSServerAutobahnTest.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WSServerAutobahnTest.scala @@ -46,7 +46,7 @@ object WSServerAutobahnTest extends App { case _ ⇒ throw new Exception("akka.ws-mode MUST be sleep or read.") } } finally { - system.shutdown() + system.terminate() } def echoWebsocketService: Flow[Message, Message, NotUsed] = diff --git a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WithMaterializerSpec.scala b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WithMaterializerSpec.scala index 41058b5f9b..34b55048d8 100644 --- a/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WithMaterializerSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/impl/engine/ws/WithMaterializerSpec.scala @@ -16,5 +16,5 @@ trait WithMaterializerSpec extends BeforeAndAfterAll { _: Suite ⇒ implicit lazy val system = ActorSystem(getClass.getSimpleName, testConf) implicit lazy val materializer = ActorMaterializer() - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() } \ No newline at end of file diff --git a/akka-http-core/src/test/scala/akka/http/scaladsl/ClientServerSpec.scala b/akka-http-core/src/test/scala/akka/http/scaladsl/ClientServerSpec.scala index c7b412c4e7..ba20ce5a8b 100644 --- a/akka-http-core/src/test/scala/akka/http/scaladsl/ClientServerSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/scaladsl/ClientServerSpec.scala @@ -449,7 +449,7 @@ class ClientServerSpec extends WordSpec with Matchers with BeforeAndAfterAll wit } override def afterAll() = { - system.shutdown() + system.terminate() system2.shutdown() } diff --git a/akka-http-core/src/test/scala/akka/http/scaladsl/TestClient.scala b/akka-http-core/src/test/scala/akka/http/scaladsl/TestClient.scala index 9234380599..58baae1ff8 100644 --- a/akka-http-core/src/test/scala/akka/http/scaladsl/TestClient.scala +++ b/akka-http-core/src/test/scala/akka/http/scaladsl/TestClient.scala @@ -28,7 +28,7 @@ object TestClient extends App { fetchServerVersion1() // Console.readLine() - // system.shutdown() + // system.terminate() def fetchServerVersion1(): Unit = { println(s"Fetching HTTPS server version of host `$host` via a direct low-level connection ...") @@ -62,5 +62,5 @@ object TestClient extends App { } } - def shutdown(): Unit = system.shutdown() + def shutdown(): Unit = system.terminate() } \ No newline at end of file diff --git a/akka-http-core/src/test/scala/akka/http/scaladsl/TestServer.scala b/akka-http-core/src/test/scala/akka/http/scaladsl/TestServer.scala index 71ae6a4c12..6b79a4d328 100644 --- a/akka-http-core/src/test/scala/akka/http/scaladsl/TestServer.scala +++ b/akka-http-core/src/test/scala/akka/http/scaladsl/TestServer.scala @@ -48,7 +48,7 @@ object TestServer extends App { println("Press RETURN to stop...") Console.readLine() } finally { - system.shutdown() + system.terminate() } ////////////// helpers ////////////// diff --git a/akka-http-core/src/test/scala/akka/http/scaladsl/model/HttpEntitySpec.scala b/akka-http-core/src/test/scala/akka/http/scaladsl/model/HttpEntitySpec.scala index eddb2dfe44..a7e3ad81db 100755 --- a/akka-http-core/src/test/scala/akka/http/scaladsl/model/HttpEntitySpec.scala +++ b/akka-http-core/src/test/scala/akka/http/scaladsl/model/HttpEntitySpec.scala @@ -33,7 +33,7 @@ class HttpEntitySpec extends FreeSpec with MustMatchers with BeforeAndAfterAll { implicit val system = ActorSystem(getClass.getSimpleName, testConf) implicit val materializer = ActorMaterializer() - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() "HttpEntity" - { "support dataBytes" - { diff --git a/akka-http-core/src/test/scala/akka/http/scaladsl/model/MultipartSpec.scala b/akka-http-core/src/test/scala/akka/http/scaladsl/model/MultipartSpec.scala index c86dd37860..3e822dd0b4 100644 --- a/akka-http-core/src/test/scala/akka/http/scaladsl/model/MultipartSpec.scala +++ b/akka-http-core/src/test/scala/akka/http/scaladsl/model/MultipartSpec.scala @@ -22,7 +22,7 @@ class MultipartSpec extends WordSpec with Matchers with Inside with BeforeAndAft implicit val system = ActorSystem(getClass.getSimpleName, testConf) import system.dispatcher implicit val materializer = ActorMaterializer() - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() "Multipart.General" should { "support `toStrict` on the streamed model" in { diff --git a/akka-http-core/src/test/scala/io/akka/integrationtest/http/HttpModelIntegrationSpec.scala b/akka-http-core/src/test/scala/io/akka/integrationtest/http/HttpModelIntegrationSpec.scala index fbd8efaf95..bcc39e4846 100644 --- a/akka-http-core/src/test/scala/io/akka/integrationtest/http/HttpModelIntegrationSpec.scala +++ b/akka-http-core/src/test/scala/io/akka/integrationtest/http/HttpModelIntegrationSpec.scala @@ -40,7 +40,7 @@ class HttpModelIntegrationSpec extends WordSpec with Matchers with BeforeAndAfte implicit val system = ActorSystem(getClass.getSimpleName, testConf) import system.dispatcher - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() implicit val materializer = ActorMaterializer() diff --git a/akka-http-testkit/src/main/scala/akka/http/javadsl/testkit/JUnitRouteTest.scala b/akka-http-testkit/src/main/scala/akka/http/javadsl/testkit/JUnitRouteTest.scala index 97336f15b5..5db4429200 100644 --- a/akka-http-testkit/src/main/scala/akka/http/javadsl/testkit/JUnitRouteTest.scala +++ b/akka-http-testkit/src/main/scala/akka/http/javadsl/testkit/JUnitRouteTest.scala @@ -66,7 +66,7 @@ class ActorSystemResource extends ExternalResource { _materializer = createMaterializer(_system) } override def after(): Unit = { - _system.shutdown() + _system.terminate() _system.awaitTermination(5.seconds) _system = null _materializer = null diff --git a/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTest.scala b/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTest.scala index a6baebf869..afd7eed06f 100644 --- a/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTest.scala +++ b/akka-http-testkit/src/main/scala/akka/http/scaladsl/testkit/RouteTest.scala @@ -43,7 +43,7 @@ trait RouteTest extends RequestBuilding with WSTestRequestBuilding with RouteTes implicit def executor = system.dispatcher implicit val materializer = ActorMaterializer() - def cleanUp(): Unit = system.shutdown() + def cleanUp(): Unit = system.terminate() private val dynRR = new DynamicVariable[RouteTestResult](null) private def result = diff --git a/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/petstore/PetStoreExample.java b/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/petstore/PetStoreExample.java index 6098480d87..66ac808762 100644 --- a/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/petstore/PetStoreExample.java +++ b/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/petstore/PetStoreExample.java @@ -65,7 +65,7 @@ public class PetStoreExample { System.out.println("Type RETURN to exit"); System.in.read(); } finally { - system.shutdown(); + system.terminate(); } } } \ No newline at end of file diff --git a/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/simple/SimpleServerApp.java b/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/simple/SimpleServerApp.java index 4526373906..f7cf210867 100644 --- a/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/simple/SimpleServerApp.java +++ b/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/simple/SimpleServerApp.java @@ -96,6 +96,6 @@ public class SimpleServerApp extends HttpApp { new SimpleServerApp().bindRoute("localhost", 8080, system); System.out.println("Type RETURN to exit"); System.in.read(); - system.shutdown(); + system.terminate(); } } \ No newline at end of file diff --git a/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/simple/SimpleServerApp8.java b/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/simple/SimpleServerApp8.java index 8d36bc6429..ebcc66b438 100644 --- a/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/simple/SimpleServerApp8.java +++ b/akka-http-tests/src/main/java/akka/http/javadsl/server/examples/simple/SimpleServerApp8.java @@ -93,7 +93,7 @@ public class SimpleServerApp8 extends HttpApp { new SimpleServerApp8().bindRoute("localhost", 8080, system); System.out.println("Type RETURN to exit"); System.in.read(); - system.shutdown(); + system.terminate(); } } diff --git a/akka-http-tests/src/test/java/akka/http/javadsl/server/directives/CodingDirectivesTest.java b/akka-http-tests/src/test/java/akka/http/javadsl/server/directives/CodingDirectivesTest.java index 81063d5358..8a21bce59e 100644 --- a/akka-http-tests/src/test/java/akka/http/javadsl/server/directives/CodingDirectivesTest.java +++ b/akka-http-tests/src/test/java/akka/http/javadsl/server/directives/CodingDirectivesTest.java @@ -30,7 +30,7 @@ public class CodingDirectivesTest extends JUnitRouteTest { @AfterClass public static void tearDown() { - system.shutdown(); + system.terminate(); system.awaitTermination(); system = null; } diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/FormDataSpec.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/FormDataSpec.scala index 9b58041dc4..259dcfee7f 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/FormDataSpec.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/FormDataSpec.scala @@ -36,7 +36,7 @@ class FormDataSpec extends WordSpec with Matchers with ScalaFutures with BeforeA } override def afterAll() = { - system.shutdown() + system.terminate() system.awaitTermination(10.seconds) } } diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/coding/CodecSpecSupport.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/coding/CodecSpecSupport.scala index 3e4a6929f9..3940d70cf3 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/coding/CodecSpecSupport.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/coding/CodecSpecSupport.scala @@ -73,7 +73,7 @@ est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscin implicit val materializer = ActorMaterializer() override def afterAll() = { - system.shutdown() + system.terminate() system.awaitTermination(10.seconds) } } diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/marshalling/MarshallingSpec.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/marshalling/MarshallingSpec.scala index b833b3834e..036078e8c8 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/marshalling/MarshallingSpec.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/marshalling/MarshallingSpec.scala @@ -140,7 +140,7 @@ class MarshallingSpec extends FreeSpec with Matchers with BeforeAndAfterAll with } } - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() protected class FixedRandom extends java.util.Random { override def nextBytes(array: Array[Byte]): Unit = "my-stable-boundary".getBytes("UTF-8").copyToArray(array) diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/ConnectionTestApp.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/ConnectionTestApp.scala index 8d288020c7..d891bc23cd 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/ConnectionTestApp.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/ConnectionTestApp.scala @@ -92,7 +92,7 @@ object ConnectionTestApp { readLine() println("===================== \n\n" + system.asInstanceOf[ActorSystemImpl].printTree + "\n\n========================") readLine() - system.shutdown() + system.terminate() } } diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/DontLeakActorsOnFailingConnectionSpecs.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/DontLeakActorsOnFailingConnectionSpecs.scala index f2b79ad422..54355e86f3 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/DontLeakActorsOnFailingConnectionSpecs.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/DontLeakActorsOnFailingConnectionSpecs.scala @@ -95,7 +95,7 @@ class DontLeakActorsOnFailingConnectionSpecs extends WordSpecLike with Matchers } override def afterAll = { - system.shutdown() + system.terminate() system.awaitTermination(3.seconds) } diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TcpLeakApp.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TcpLeakApp.scala index 0afb6cff95..01c4555cf2 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TcpLeakApp.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TcpLeakApp.scala @@ -43,5 +43,5 @@ object TcpLeakApp extends App { } readLine() - system.shutdown() + system.terminate() } diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TestServer.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TestServer.scala index f7ee4efaad..d6f3906a90 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TestServer.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/server/TestServer.scala @@ -51,7 +51,7 @@ object TestServer extends App { println(s"Server online at http://localhost:8080/\nPress RETURN to stop...") Console.readLine() - bindingFuture.flatMap(_.unbind()).onComplete(_ ⇒ system.shutdown()) + bindingFuture.flatMap(_.unbind()).onComplete(_ ⇒ system.terminate()) lazy val index = diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/MultipartUnmarshallersSpec.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/MultipartUnmarshallersSpec.scala index ee29686d45..f9543bdef2 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/MultipartUnmarshallersSpec.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/MultipartUnmarshallersSpec.scala @@ -298,7 +298,7 @@ class MultipartUnmarshallersSpec extends FreeSpec with Matchers with BeforeAndAf } } - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() def haveParts[T <: Multipart](parts: Multipart.BodyPart.Strict*): Matcher[Future[T]] = equal(parts).matcher[Seq[Multipart.BodyPart.Strict]] compose { x ⇒ diff --git a/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/UnmarshallingSpec.scala b/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/UnmarshallingSpec.scala index d794935dd9..0234184da7 100644 --- a/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/UnmarshallingSpec.scala +++ b/akka-http-tests/src/test/scala/akka/http/scaladsl/unmarshalling/UnmarshallingSpec.scala @@ -23,5 +23,5 @@ class UnmarshallingSpec extends FreeSpec with Matchers with BeforeAndAfterAll wi Unmarshal(HttpEntity("árvíztűrő ütvefúrógép")).to[Array[Char]] should evaluateTo("árvíztűrő ütvefúrógép".toCharArray) } } - override def afterAll() = system.shutdown() + override def afterAll() = system.terminate() } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala index 662ac1da53..14529184ba 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/NewRemoteActorSpec.scala @@ -52,7 +52,7 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec) def initialParticipants = roles.size - // ensure that system shutdown is successful + // ensure that system.terminate is successful override def verifySystemShutdown = true "A new remote actor" must { @@ -116,7 +116,7 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec) enterBarrier("deployed") // master system is supposed to be shutdown after slave - // this should be triggered by slave system shutdown + // this should be triggered by slave system.terminate expectMsgPF() { case Terminated(`actor`) ⇒ true } } @@ -126,7 +126,7 @@ class NewRemoteActorSpec extends MultiNodeSpec(NewRemoteActorMultiJvmSpec) // Important that this is the last test. // It should not be any barriers here. - // verifySystemShutdown = true will ensure that system shutdown is successful + // verifySystemShutdown = true will ensure that system.terminate is successful } } } diff --git a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteRestartedQuarantinedSpec.scala b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteRestartedQuarantinedSpec.scala index b3523e8650..cdba6a21b6 100644 --- a/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteRestartedQuarantinedSpec.scala +++ b/akka-remote-tests/src/multi-jvm/scala/akka/remote/RemoteRestartedQuarantinedSpec.scala @@ -45,7 +45,7 @@ object RemoteRestartedQuarantinedSpec extends MultiNodeConfig { class Subject extends Actor { def receive = { - case "shutdown" ⇒ context.system.shutdown() + case "shutdown" ⇒ context.system.terminate() case "identify" ⇒ sender() ! (AddressUidExtension(context.system).addressUid, self) } } diff --git a/akka-stream-tests-tck/src/test/scala/akka/stream/tck/ActorSystemLifecycle.scala b/akka-stream-tests-tck/src/test/scala/akka/stream/tck/ActorSystemLifecycle.scala index 9bbf0a805b..b0e915e183 100644 --- a/akka-stream-tests-tck/src/test/scala/akka/stream/tck/ActorSystemLifecycle.scala +++ b/akka-stream-tests-tck/src/test/scala/akka/stream/tck/ActorSystemLifecycle.scala @@ -31,7 +31,7 @@ trait ActorSystemLifecycle { @AfterClass def shutdownActorSystem(): Unit = { try { - system.shutdown() + system.terminate() system.awaitTermination(shutdownTimeout) } catch { case _: TimeoutException ⇒ diff --git a/akka-stream-tests/src/test/scala/akka/stream/ActorMaterializerSpec.scala b/akka-stream-tests/src/test/scala/akka/stream/ActorMaterializerSpec.scala index 47a6ebdcbe..f282947502 100644 --- a/akka-stream-tests/src/test/scala/akka/stream/ActorMaterializerSpec.scala +++ b/akka-stream-tests/src/test/scala/akka/stream/ActorMaterializerSpec.scala @@ -61,7 +61,7 @@ class ActorMaterializerSpec extends AkkaSpec with ImplicitSender { "report correctly if it has been shut down from the side" in { val sys = ActorSystem() val m = ActorMaterializer.create(sys) - sys.shutdown() + sys.terminate() sys.awaitTermination() m.isShutdown should ===(true) } diff --git a/akka-testkit/src/main/scala/akka/testkit/TestKit.scala b/akka-testkit/src/main/scala/akka/testkit/TestKit.scala index 41cf7c8e9f..3e1a7ba53d 100644 --- a/akka-testkit/src/main/scala/akka/testkit/TestKit.scala +++ b/akka-testkit/src/main/scala/akka/testkit/TestKit.scala @@ -712,7 +712,7 @@ trait TestKitBase { * } * * } finally { - * system.shutdown() + * system.terminate() * } * } * }}}