Java – how to simulate an actor based on actorselection?
•
Java
I have searched a lot about this, but there is no answer
I have an actor "a" (user / a). When I receive the message "m", it sends the message "X" to another actor "B" (user / b) To do this, actor a uses actor selection. I need to test. When I send m to a, B will receive "X"
I tried to do this with testprobe on user / B, but failed
I also saw some similar questions, but each answer said actorref using actorref This is not my choice. I really need to use actorselection
Does anyone have an idea?
Solution
Simple answer: instead of hard coding the selection path in configurable a make In the test, you can point it to the path of testprobe
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码