【发布时间】:2021-07-01 09:13:58
【问题描述】:
我是 bndtools 的新手。我想使用 testcontainers (https://www.testcontainers.org/) 来测试应该连接到 MQTT 代理的 osgi 包。所以我可以测试连接、连接丢失等策略。 我不明白 maven 和 bnd 存储库是如何一起工作的,所以在我理解之前,我不使用 maven。然后我尝试通过将其添加到 build.bnd 来“导入”测试容器:
-plugin.6.junit: \
aQute.bnd.repository.maven.pom.provider.BndPomRepository; \
releaseUrl=https://repo.maven.apache.org/maven2/; \
readOnly=true; \
name="Maven Central JUNIT";\
revision="org.osgi:org.osgi.test.junit5:0.10.0,\
org.osgi:org.osgi.test.junit4:0.10.0", \
org.testcontainers:testcontainers:1.15.2
但是 bnd 说“无法加载插件 org.testcontainers:testcontainers:1.15.2。” 我迷路了……
【问题讨论】:
-
如果您正在测试 MQTT,您可能需要查看 github.com/aQute-os/biz.aQute.osgi.util/tree/master/…。它使用 Launchpad,这意味着您需要严格遵循 API 和实现分离,这无论如何都有巨大的好处。
标签: testing osgi bnd testcontainers-junit5