从IntelliJ运行Corda流测试时出错 [英] Error when running Corda flow tests from IntelliJ

查看:52
本文介绍了从IntelliJ运行Corda流测试时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从IntelliJ运行Corda流测试时,测试失败,并出现以下错误:

When I run Corda flow tests from IntelliJ, the tests fail with the following errors:


QUASAR警告:Quasar Java Agent不是'运行。如果您使用
,则可以忽略此消息;否则,
请参阅Quasar
文档中的入门部分。

QUASAR WARNING: Quasar Java Agent isn't running. If you're using another instrumentation method you can ignore this message; otherwise, please refer to the Getting Started section in the Quasar documentation.


java.lang.IllegalStateException:缺少'-javaagent'JVM
参数。确保在将Quasar Java代理
附加到JVM的情况下运行测试。请参见 https://docs.corda.net/troubleshooting.html
-'Fiber

java.lang.IllegalStateException: Missing the '-javaagent' JVM argument. Make sure you run the tests with the Quasar java agent attached to your JVM. See https://docs.corda.net/troubleshooting.html - 'Fiber classes not instrumented' for more details.

我该如何解决?

推荐答案

Corda流需要在运行前使用Quasar进行检测,以便可以在执行中暂停。

Corda flows need to be instrumented using Quasar before they are run, so that they can be suspended mid-execution.

要在IntelliJ中实现此目的,您需要:

To achieve this in IntelliJ, you need to:


  • 为测试创建运行配置

  • 打开运行配置并将VM选项更改为 -ea -javaagent:PATH-TO-QUASAR-JAR


    • 在CorDapp示例和模板中, quasar.jar 位于 lib / quasar.jar ,因此您d使用 -ea -javaagent:../ lib / quasar.jar

    • Create a run config for your tests
    • Open the run config and change the VM options to -ea -javaagent:PATH-TO-QUASAR-JAR
      • In the CorDapp example and templates, quasar.jar is located at lib/quasar.jar, so you'd use -ea -javaagent:../lib/quasar.jar

      或者,您可以编辑默认的JUnit运行配置,以默认情况下使用Quasar javaagent,避免您不必这样做在您选择要运行的新测试时。

      Alternatively, you can edit the default JUnit run config to use the Quasar javaagent by default, avoiding you having to do this every time you pick a new test to run.

      这篇关于从IntelliJ运行Corda流测试时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆