【发布时间】:2013-09-13 12:47:04
【问题描述】:
我正在尝试使用 information provided here 测试 Akka FSM。但是,当我的Actor with FSM 子类需要实例化参数时,我无法弄清楚如何创建TestFSMRef。
对于标准的非 FSM 测试,我通过以下方式创建 TestActorRef:
val testActor = TestActorRef(MyActorFSM.props("nl", p1, p2))
.props 方法是按照documented Recommended Practice 实现的。我尝试实例化一个testActor,然后将其传递给 TestFSMRef 构造函数:
val fsm = TestFSMRef(testActor)
但这不会编译:
inferred type arguments [Nothing,Nothing,akka.testkit.TestActorRef[Nothing]]
do not conform to method apply's type parameter bounds [S,D,T <: akka.actor.Actor]
【问题讨论】: