rename AkkaSpec.{atTermination => afterTermination}
This commit is contained in:
parent
ff24be7650
commit
6c31d5313e
15 changed files with 19 additions and 19 deletions
|
|
@ -100,7 +100,7 @@ abstract class LargeClusterSpec
|
||||||
*/
|
*/
|
||||||
override def cluster: Cluster = Cluster(system)
|
override def cluster: Cluster = Cluster(system)
|
||||||
|
|
||||||
override def atTermination(): Unit = {
|
override def afterTermination(): Unit = {
|
||||||
systems foreach { _.shutdown }
|
systems foreach { _.shutdown }
|
||||||
val shutdownTimeout = 20.seconds
|
val shutdownTimeout = 20.seconds
|
||||||
val deadline = Deadline.now + shutdownTimeout
|
val deadline = Deadline.now + shutdownTimeout
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,7 @@ class MyMailboxSpec extends DurableMailboxSpec("MyStorage", MyMailboxSpec.config
|
||||||
override def atStartup() {
|
override def atStartup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override def atTermination() {
|
override def afterTermination() {
|
||||||
}
|
}
|
||||||
|
|
||||||
"MyMailbox" must {
|
"MyMailbox" must {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ class RemoteDeploymentDocSpec extends AkkaSpec("""
|
||||||
val other = ActorSystem("remote", system.settings.config)
|
val other = ActorSystem("remote", system.settings.config)
|
||||||
val address = other.asInstanceOf[ExtendedActorSystem].provider.getExternalAddressFor(Address("tcp.akka", "s", "host", 1)).get
|
val address = other.asInstanceOf[ExtendedActorSystem].provider.getExternalAddressFor(Address("tcp.akka", "s", "host", 1)).get
|
||||||
|
|
||||||
override def atTermination() { other.shutdown() }
|
override def afterTermination() { other.shutdown() }
|
||||||
|
|
||||||
"demonstrate programmatic deployment" in {
|
"demonstrate programmatic deployment" in {
|
||||||
//#deploy
|
//#deploy
|
||||||
|
|
|
||||||
|
|
@ -45,8 +45,8 @@ class FileBasedMailboxSpec extends DurableMailboxSpec("File", FileBasedMailboxSp
|
||||||
super.atStartup()
|
super.atStartup()
|
||||||
}
|
}
|
||||||
|
|
||||||
override def atTermination() {
|
override def afterTermination() {
|
||||||
clean()
|
clean()
|
||||||
super.atTermination()
|
super.afterTermination()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,14 +84,14 @@ abstract class DurableMailboxSpec(system: ActorSystem, val backendName: String)
|
||||||
try system.awaitTermination(5 seconds) catch {
|
try system.awaitTermination(5 seconds) catch {
|
||||||
case _: TimeoutException ⇒ system.log.warning("Failed to stop [{}] within 5 seconds", system.name)
|
case _: TimeoutException ⇒ system.log.warning("Failed to stop [{}] within 5 seconds", system.name)
|
||||||
}
|
}
|
||||||
atTermination()
|
afterTermination()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* May be implemented in concrete subclass to do additional things once after all
|
* May be implemented in concrete subclass to do additional things once after all
|
||||||
* test cases have been run.
|
* test cases have been run.
|
||||||
*/
|
*/
|
||||||
def atTermination() {}
|
def afterTermination() {}
|
||||||
|
|
||||||
protected def streamMustContain(in: InputStream, words: String): Unit = {
|
protected def streamMustContain(in: InputStream, words: String): Unit = {
|
||||||
val output = new Array[Byte](8192)
|
val output = new Array[Byte](8192)
|
||||||
|
|
|
||||||
|
|
@ -272,7 +272,7 @@ abstract class MultiNodeSpec(val myself: RoleName, _system: ActorSystem, _roles:
|
||||||
if (verifySystemShutdown) throw new RuntimeException(msg)
|
if (verifySystemShutdown) throw new RuntimeException(msg)
|
||||||
else system.log.warning(msg)
|
else system.log.warning(msg)
|
||||||
}
|
}
|
||||||
atTermination()
|
afterTermination()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -293,7 +293,7 @@ abstract class MultiNodeSpec(val myself: RoleName, _system: ActorSystem, _roles:
|
||||||
/**
|
/**
|
||||||
* Override this method to do something when the whole test is terminating.
|
* Override this method to do something when the whole test is terminating.
|
||||||
*/
|
*/
|
||||||
protected def atTermination(): Unit = {}
|
protected def afterTermination(): Unit = {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* All registered roles
|
* All registered roles
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ akka {
|
||||||
|
|
||||||
val here = system.actorFor(RootActorPath(remoteAddr) / "user" / "echo")
|
val here = system.actorFor(RootActorPath(remoteAddr) / "user" / "echo")
|
||||||
|
|
||||||
override def atTermination() {
|
override def afterTermination() {
|
||||||
other.shutdown()
|
other.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ akka {
|
||||||
EventFilter.warning(pattern = "received dead letter.*Disassociate")))
|
EventFilter.warning(pattern = "received dead letter.*Disassociate")))
|
||||||
}
|
}
|
||||||
|
|
||||||
override def atTermination() {
|
override def afterTermination() {
|
||||||
other.shutdown()
|
other.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ akka.actor.deployment {
|
||||||
}""").withFallback(system.settings.config)
|
}""").withFallback(system.settings.config)
|
||||||
val otherSystem = ActorSystem("remote-sys", conf)
|
val otherSystem = ActorSystem("remote-sys", conf)
|
||||||
|
|
||||||
override def atTermination() {
|
override def afterTermination() {
|
||||||
otherSystem.shutdown()
|
otherSystem.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ class RemotingSpec extends AkkaSpec(RemotingSpec.cfg) with ImplicitSender with D
|
||||||
|
|
||||||
val here = system.actorFor("test.akka://remote-sys@localhost:12346/user/echo")
|
val here = system.actorFor("test.akka://remote-sys@localhost:12346/user/echo")
|
||||||
|
|
||||||
override def atTermination() {
|
override def afterTermination() {
|
||||||
other.shutdown()
|
other.shutdown()
|
||||||
AssociationRegistry.clear()
|
AssociationRegistry.clear()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ abstract class Ticket1978CommunicationSpec(val cipherConfig: CipherConfig) exten
|
||||||
"remote-sys",
|
"remote-sys",
|
||||||
ConfigFactory.parseString("akka.remote.netty.port=" + cipherConfig.remotePort).withFallback(system.settings.config))
|
ConfigFactory.parseString("akka.remote.netty.port=" + cipherConfig.remotePort).withFallback(system.settings.config))
|
||||||
|
|
||||||
override def atTermination() {
|
override def afterTermination() {
|
||||||
if (cipherConfig.runTest) {
|
if (cipherConfig.runTest) {
|
||||||
other.shutdown()
|
other.shutdown()
|
||||||
other.awaitTermination()
|
other.awaitTermination()
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ akka.loglevel = DEBUG
|
||||||
val target1 = other.actorFor(RootActorPath(addr) / "remote")
|
val target1 = other.actorFor(RootActorPath(addr) / "remote")
|
||||||
val target2 = other.actorFor(RootActorPath(addr) / testActor.path.elements)
|
val target2 = other.actorFor(RootActorPath(addr) / testActor.path.elements)
|
||||||
|
|
||||||
override def atTermination() {
|
override def afterTermination() {
|
||||||
other.shutdown()
|
other.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,6 +96,6 @@ class AkkaProtocolStressTest extends AkkaSpec(configA) with ImplicitSender with
|
||||||
EventFilter.warning(pattern = "received dead letter.*(InboundPayload|Disassociate)")))
|
EventFilter.warning(pattern = "received dead letter.*(InboundPayload|Disassociate)")))
|
||||||
}
|
}
|
||||||
|
|
||||||
override def atTermination(): Unit = systemB.shutdown()
|
override def afterTermination(): Unit = systemB.shutdown()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ class ThrottlerTransportAdapterSpec extends AkkaSpec(configA) with ImplicitSende
|
||||||
EventFilter.warning(pattern = "received dead letter.*(InboundPayload|Disassociate)")))
|
EventFilter.warning(pattern = "received dead letter.*(InboundPayload|Disassociate)")))
|
||||||
}
|
}
|
||||||
|
|
||||||
override def atTermination(): Unit = systemB.shutdown()
|
override def afterTermination(): Unit = systemB.shutdown()
|
||||||
}
|
}
|
||||||
|
|
||||||
class ThrottlerTransportAdapterGenericSpec extends GenericTransportSpec(withAkkaProtocol = true) {
|
class ThrottlerTransportAdapterGenericSpec extends GenericTransportSpec(withAkkaProtocol = true) {
|
||||||
|
|
|
||||||
|
|
@ -77,14 +77,14 @@ abstract class AkkaSpec(_system: ActorSystem)
|
||||||
system.log.warning("Failed to stop [{}] within 5 seconds", system.name)
|
system.log.warning("Failed to stop [{}] within 5 seconds", system.name)
|
||||||
println(system.asInstanceOf[ActorSystemImpl].printTree)
|
println(system.asInstanceOf[ActorSystemImpl].printTree)
|
||||||
}
|
}
|
||||||
atTermination()
|
afterTermination()
|
||||||
}
|
}
|
||||||
|
|
||||||
protected def atStartup() {}
|
protected def atStartup() {}
|
||||||
|
|
||||||
protected def beforeTermination() {}
|
protected def beforeTermination() {}
|
||||||
|
|
||||||
protected def atTermination() {}
|
protected def afterTermination() {}
|
||||||
|
|
||||||
def spawn(dispatcherId: String = Dispatchers.DefaultDispatcherId)(body: ⇒ Unit): Unit =
|
def spawn(dispatcherId: String = Dispatchers.DefaultDispatcherId)(body: ⇒ Unit): Unit =
|
||||||
Future(body)(system.dispatchers.lookup(dispatcherId))
|
Future(body)(system.dispatchers.lookup(dispatcherId))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue