- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在使用 Akka testkit 库来测试我的几个 Actor 。
这是我的 build.sbt 中的内容:
"com.typesafe.akka" %% "akka-testkit" % "2.6.10" % Test,
这是我得到的错误:
java.lang.IllegalStateException: You are using version 2.6.10 of Akka, but it appears you (perhaps indirectly) also depend on older versions of related artifacts. You can solve this by adding an explicit dependency on version 2.6.10 of the [akka-actor-typed, akka-slf4j, akka-protobuf-v3, akka-stream, akka-serialization-jackson] artifacts to your project. See also: https://doc.akka.io/docs/akka/current/common/binary-compatibility-rules.html#mixed-versioning-is-not-allowed
我很困惑,因为我对 Akka 没有任何其他依赖,因为这里是我的 build.sbt 中定义的所有依赖:
libraryDependencies ++= Seq(
ws,
// Our streaming library
"io.monix" %% "monix" % "3.3.0",
// Dependencies needed for Slick
"com.typesafe.slick" %% "slick" % "3.3.3",
"com.typesafe.slick" %% "slick-hikaricp" % "3.3.3",
// For application Metrics
"io.dropwizard.metrics" % "metrics-core" % "4.1.16",
"io.dropwizard.metrics" % "metrics-jvm" % "4.1.16",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.2",
"org.scala-lang.modules" % "scala-async_2.11" % "0.9.7",
"com.typesafe" % "config" % "1.4.1",
// For JSON parsing
"com.typesafe.play" %% "play-json" % "2.9.1",
"com.typesafe.play" %% "play-json-joda" % "2.9.1",
// JDBC driver for MySQL & H2
"mysql" % "mysql-connector-java" % "8.0.22",
"com.h2database" % "h2" % "1.4.186",
// Test dependencies
"com.typesafe.akka" %% "akka-testkit" % "2.6.10" % Test,
"org.scalatest" %% "scalatest" % "3.2.3" % Test,
"org.awaitility" % "awaitility" % "4.0.3" % Test,
"org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test exclude ("org.slf4j", "slf4j-simple"),
"com.github.andyglow" %% "websocket-scala-client" % "0.3.0" % Test exclude ("org.slf4j", "slf4j-simple")
)
关于如何解决这个问题有什么想法吗?
最佳答案
所以我不得不像这样为 Akka 添加一些依赖项:
"com.typesafe.akka" %% "akka-testkit" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-slf4j" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-protobuf-v3" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-serialization-jackson" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-stream" % AkkaVersion % Test,
"com.typesafe.akka" %% "akka-actor-typed" % AkkaVersion % Test,
AkkaVersion 在我的例子中是 2.6.10
不得不提及这些依赖关系看起来很难看,但这是我能够摆脱错误的方式。
关于sbt - 具有模糊版本错误的 Akka Testkit 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65160905/
我正在尝试记录TestKit TestProbe收到的所有消息,事实证明这有些困难。我知道文档中的Actor Logging部分,其中说应该将debug.receive选项与LogginReceive
我在同一个类中有一系列测试都测试相同的功能,我如何跳过/忽略单个测试,例如: class FooTest(_system: ActorSystem) extends TestKit(_system)
我正在使用 Akka testkit 库来测试我的几个 Actor 。 这是我的 build.sbt 中的内容: "com.typesafe.akka" %% "akka-testkit" % "2.
为 TestProbe.expectNoMsg() 设置默认超时的正确方法是什么?在代码中不在配置中? 我知道我可以定义 akka.test.single-expect-default在 applic
我从 http://doc.akka.io/docs/akka/snapshot/scala/testing.html#Using_Multiple_Probe_Actors 扩展了示例. impor
我正在尝试将Gradle TestKit与JaCoCo集成。我正在使用这个插件 https://github.com/koral--/jacoco-gradle-testkit-plugin 这会创建
我正在尝试使用 Akka 的 TestKit 制作 specs2 测试。我被一个持续的编译错误困住了,我不知道如何解决,我很感激建议。 编译错误是: TaskSpec.scala:40: parent
我一直在尝试在我的 scalaTest 中这样记录事情: class ChangeSetActorTest extends PersistenceSpec(ActorSystem("Persisten
根据docs ,在(预期日志消息)下, Be sure to exchange the default logger with the TestEventListener in your applic
在这个例子中: http://doc.akka.io/docs/akka/snapshot/java/testing.html final Props props = Props.create(MyA
我正在使用 TestKit 测试我正在从事的涉及 Akka Actors 的 Scala 项目的一些类,我遇到了这个问题: 一个或多个请求的类不是套件:poc.PocConstituentsWatch
我对一个 actor 进行了测试,该 actor 可能会响应一些意外消息,但最终它必须响应特定的已知消息。所以本质上我想要一个断言,它会在某个时间跨度内忽略其他消息,但期待一个已知消息,就像这样:
我正在尝试测试我的 Akka.NET actors,但在使用 TestKit 和理解它的工作原理时遇到了一些问题。 由于 Akka.NET 中还没有关于单元测试的官方文档,我已经探索了 Akka.NE
我有一个 Akka Actor,它使用 Ask 模式从子 Actor 检索 Future 并对成功和失败采取行动。我不知道如何模拟 child Actor 并以失败作为回应。 这是代码: import
鉴于我有一个注入(inject)了 child actor 的 Supervisor actor,我该如何向 child 发送 PoisonPill 消息并使用 TestKit 对其进行测试? 这是我
自从将 Gradle 升级到版本 6 后,我注意到与我使用 TestKit 实现的功能测试相关的新警告。我很清楚如何摆脱它们。不清楚的是它们为什么首先出现,以及它们在功能测试的上下文中有何相关性。 这
Java 8 和 Akka (Java API) 2.12:2.5.16 在这里。我收到以下消息: public class SomeMessage { private int another
对akka Actor 来说有点新意 但希望了解 TestKit 、 TastActorRef 和 TestProbe 之间的用途和区别 在akka单元测试中使用。 我已经看到它们用于单元测试 akk
在我的 Scala 应用程序中,假设我有 Actor A 和 Actor B。我想在 ScalaTest 中设计一个测试用例,它允许我向 Actor A 发送消息,并查看它向 Actor B 发送什么
我正在对使用集群工具的参与者进行单元测试 DistributedPubSub .对于测试,我使用 Akka.net 的 TestKit。 显然,在 TestKit 中,系统参与者 Sys没有 Dist
我是一名优秀的程序员,十分优秀!