stuff moved to a new package. you wouldn't expect that in a point
release, but they put type aliases in place so Scala users wouldn't
notice. but the change is visible to Java code.
the upgrade is not strictly necessary, but it would be convenient
for the Scala 2.13 community build to have this merged, so I don't
have to maintain these changes in our Akka fork
* Walk stack to figure out logger class
* User API for getting a customized logger
* API to set logger class, use in receptionists, auto-good-class for EventSourcedBehavior
* Effect.stash, Effect.thenUnstashAll
* unstash one at a time, and start with external stash if UnstashAll is in progress
* handle restarts
* handle PoisonPill
* fix PerformanceSpec, because now the internal stash is cleared if exception is thrown
* work with PoisonPill
* stash messages and signals while waiting for children to be stopped
* handle watch of other actors
* exception from unstash
* exception from first setup
* merge RestartSupervisor and BackoffSupervisor
* API change: restartWithLimit => restart.withLimit
* remove unused PreStart
* docs
* move BubblingSample to separate class
* fix: fail after more than limit in restart.withLimit when deferred factory throws
* match case RestartOrBackoff instead
* use receiveOne instead of receiveMessageType, #25914
* when the type is the same as the probe's type
* formatting
* rename receiveOne to receiveMessage
* rename receiveN to receiveMessages
* have to use different name in javadsl so that became receiveSeveralMessages
* Add CopyrightHeader support for sbt-boilerplate plugin.
* Add CopyrightHeader support for `*.proto` files.
* Add regex match for both `–` and `-` for CopyrightHeader.
* Add CopyrightHeader support for sbt build files.
* Update copyright from 2018 to 2019.
* Added ActorTestKit#stop method and corresponding tests.
* Added 'Stopping actors' section to the docs
* Stop actor now waits until the actor terminates.
* Remove exception from typed Terminated
This currently only works for direct child actors and breaks when using
typed supervision.
It could be re-introduced by supervision returning a new special
behavior that the actor adaper for failed with an exception.
* Try out keeping the terminated and adding a ChildTerminated subclass of Terminated
Some tests need updated will fix those if we decide this is better
* Fix duplicate logging + make it Terminated + ChildFailed
* [ttk] Add access to logged events in BehaviorTestKit #25905
`BehaviorTestKit` now has methods to:
- Access to logged events
- Clear all log events
Added section in docs explaining how to check for logs.
Note about the implementation: `CapturedLogEvent` was effectively private to akka. It uses `OptionVal` internally, this makes it impossible to be used from outside akka. To overcome this, I added some methods to translate it to the corresponding `Option` and `Optional`.
* Apply feedback
Clean up `CapturedLogEvent` by using only `Option` in public methods
Use `immutable.Seq` instead of plain `Seq`
* Tighten MatchError handling in fishForMessage
Avoid a whole bunch of other code being accidentally handled.
Also it allows for the inner 'loop' method to be @tailrec (next commit).
* Guarantee match exhaustion in fishForMessage
... by introducing FishingOutcome.ContinueOutcome to the type hierarchy.
* Simplify some timeout calculation in fishForMessage
'timeout' is always finite, as it's a `FiniteDuration`, and, even if it
weren't, the calculation is safe for non-finite durations.
* Make fishForMessage's inner loop @tailrec!
Apparently @tailrec and try/catch (with a re-throw in the catch) don't
mix well.
* Avoid double handing of timeouts in fishForMessage
If 'newTimeout' is sub-zero, just loop again which will trigger the
other throw.
* Make receiveOne return Option[M] rather than nullable M
Avoid future users from forgetting to consider the null case, which
happened in fishForMessage_internal.
* Switch to pattern matching Options
* Cast properly
Thanks, type inferencer, for inferring Nothing there! o_O
* Make fish's PartialFunction convenience explicit
* Update the scaladsl fishForMessage Scaladocs
* Restore MatchError catching logic & docs
TIL partial functions aren't of class PartialFunction anymore, they're
lambda classes.
* Tweak assertFail so it can be used more
* Avoid name shadowing
... on request. (I <3 name shadowing)
* Fix formatting
* Avoid calling asInstanceOf in dilated
* Fix the rounding in dilated for Java
* Delegate Java dilated to Scala dilated
* Import scala.concurrent.duration.Duration
* Fix for issue #25616
I haven't had a chance to test this, but it looks to me that this is the solution to issue #25616.
My stacktrace in this issue is this:
```
java.lang.NullPointerException
at eu.phy_awaas.irods.typed.lockingsystem.IRODSLockManagerSpec.$anonfun$new$20(IRODSLockManagerSpec.scala:91)
at akka.actor.testkit.typed.internal.TestProbeImpl.loop$1(TestProbeImpl.scala:189)
at akka.actor.testkit.typed.internal.TestProbeImpl.loop$1(TestProbeImpl.scala:201)
at akka.actor.testkit.typed.internal.TestProbeImpl.fishForMessage_internal(TestProbeImpl.scala:215)
at akka.actor.testkit.typed.internal.TestProbeImpl.fishForMessage_internal(TestProbeImpl.scala:45)
at akka.actor.testkit.typed.scaladsl.TestProbe.fishForMessage(TestProbe.scala:175)
at akka.actor.testkit.typed.scaladsl.TestProbe.fishForMessage$(TestProbe.scala:174)
at akka.actor.testkit.typed.internal.TestProbeImpl.fishForMessage(TestProbeImpl.scala:45)
at akka.actor.testkit.typed.scaladsl.TestProbe.fishForMessage(TestProbe.scala:181)
at akka.actor.testkit.typed.scaladsl.TestProbe.fishForMessage$(TestProbe.scala:180)
at akka.actor.testkit.typed.internal.TestProbeImpl.fishForMessage(TestProbeImpl.scala:45)
at eu.phy_awaas.irods.typed.lockingsystem.IRODSLockManagerSpec.$anonfun$new$18(IRODSLockManagerSpec.scala:88)
at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
at org.scalatest.Transformer.apply(Transformer.scala:22)
at org.scalatest.Transformer.apply(Transformer.scala:20)
at org.scalatest.WordSpecLike$$anon$1.apply(WordSpecLike.scala:1078)
at org.scalatest.TestSuite.withFixture(TestSuite.scala:196)
at org.scalatest.TestSuite.withFixture$(TestSuite.scala:195)
at org.scalatest.WordSpec.withFixture(WordSpec.scala:1881)
at org.scalatest.WordSpecLike.invokeWithFixture$1(WordSpecLike.scala:1076)
at org.scalatest.WordSpecLike.$anonfun$runTest$1(WordSpecLike.scala:1088)
at org.scalatest.SuperEngine.runTestImpl(Engine.scala:289)
at org.scalatest.WordSpecLike.runTest(WordSpecLike.scala:1088)
at org.scalatest.WordSpecLike.runTest$(WordSpecLike.scala:1070)
at org.scalatest.WordSpec.runTest(WordSpec.scala:1881)
at org.scalatest.WordSpecLike.$anonfun$runTests$1(WordSpecLike.scala:1147)
at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:396)
at scala.collection.immutable.List.foreach(List.scala:389)
at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:384)
at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:373)
at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:410)
at scala.collection.immutable.List.foreach(List.scala:389)
at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:384)
at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:373)
at org.scalatest.SuperEngine.$anonfun$runTestsInBranch$1(Engine.scala:410)
at scala.collection.immutable.List.foreach(List.scala:389)
at org.scalatest.SuperEngine.traverseSubNodes$1(Engine.scala:384)
at org.scalatest.SuperEngine.runTestsInBranch(Engine.scala:379)
at org.scalatest.SuperEngine.runTestsImpl(Engine.scala:461)
at org.scalatest.WordSpecLike.runTests(WordSpecLike.scala:1147)
at org.scalatest.WordSpecLike.runTests$(WordSpecLike.scala:1146)
at org.scalatest.WordSpec.runTests(WordSpec.scala:1881)
at org.scalatest.Suite.run(Suite.scala:1147)
at org.scalatest.Suite.run$(Suite.scala:1129)
at org.scalatest.WordSpec.org$scalatest$WordSpecLike$$super$run(WordSpec.scala:1881)
at org.scalatest.WordSpecLike.$anonfun$run$1(WordSpecLike.scala:1192)
at org.scalatest.SuperEngine.runImpl(Engine.scala:521)
at org.scalatest.WordSpecLike.run(WordSpecLike.scala:1192)
at org.scalatest.WordSpecLike.run$(WordSpecLike.scala:1190)
at eu.phy_awaas.irods.typed.lockingsystem.IRODSLockManagerSpec.org$scalatest$BeforeAndAfterAll$$super$run(IRODSLockManagerSpec.scala:22)
at org.scalatest.BeforeAndAfterAll.liftedTree1$1(BeforeAndAfterAll.scala:213)
at org.scalatest.BeforeAndAfterAll.run(BeforeAndAfterAll.scala:210)
at org.scalatest.BeforeAndAfterAll.run$(BeforeAndAfterAll.scala:208)
at eu.phy_awaas.irods.typed.lockingsystem.IRODSLockManagerSpec.run(IRODSLockManagerSpec.scala:22)
at org.scalatest.tools.SuiteRunner.run(SuiteRunner.scala:45)
at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$13(Runner.scala:1340)
at org.scalatest.tools.Runner$.$anonfun$doRunRunRunDaDoRunRun$13$adapted(Runner.scala:1334)
at scala.collection.immutable.List.foreach(List.scala:389)
at org.scalatest.tools.Runner$.doRunRunRunDaDoRunRun(Runner.scala:1334)
at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24(Runner.scala:1031)
at org.scalatest.tools.Runner$.$anonfun$runOptionallyWithPassFailReporter$24$adapted(Runner.scala:1010)
at org.scalatest.tools.Runner$.withClassLoaderAndDispatchReporter(Runner.scala:1500)
at org.scalatest.tools.Runner$.runOptionallyWithPassFailReporter(Runner.scala:1010)
at org.scalatest.tools.Runner$.run(Runner.scala:850)
at org.scalatest.tools.Runner.run(Runner.scala)
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.runScalaTest2(ScalaTestRunner.java:131)
at org.jetbrains.plugins.scala.testingSupport.scalaTest.ScalaTestRunner.main(ScalaTestRunner.java:28)
```
With the calling code looking like this:
```scala
val lockResults =
probe.fishForMessage(Duration.create(10000, "ms"))(l => {
r += 1
if (r < 5) {
l.lock.use(())//crash happens here
FishingOutcomes.continue
} else {
l.lock.use(())
FishingOutcomes.complete
}
})
```
It's pretty obvious receiveOne(timeout) returns a null when it receives nothing before the timeout, passes that along to my fisher function, which tries to perform work on the supposed message only to get a null instead.
* Added missing brace
* Manually formatted my code the way akka likes
I don't have the set up to compile this right now, so I just manually inserted the formatting that jenkins mentioned.
* More changes to fit the akka formatting standard
* Test for the new assertion error when fishing times out.
* Cleaned up a flaw I added from when I initially put this in async spec
* to make it possible to use ActorContext.ask also with EntityRef
destinations
* this abstraction will probably be useful for other things, where a
full ActorRef is not required
* a RecipientRef only has to support tell (and ask), while a full ActorRef
is watchable (destination has a lifecycle) and location transparent (serializable)
* composition is the basic building block for ActorTestKit
* ActorTestKitWordSpec for integration with ScalaTest
(automatic shutdown)
* Use ActorTestKitWordSpec in our own tests
* doc TestException