CORDA-2715 - Update test runner instructions for CorDapp tutorial (#4863)

* made consistent with template review

* fixing nested bullet layouts

* updating based on (awesome) comments

* next iteration :-)

* more fixes
This commit is contained in:
Ben Wyeth 2019-03-12 10:26:17 +00:00 committed by Tommy Lillehagen
parent b98ed6db23
commit 76b07967e2

View File

@ -481,6 +481,45 @@ Integration tests
~~~~~~~~~~~~~~~~~
You can run the CorDapp's integration tests by running the ``Run Integration Tests - Kotlin`` run configuration.
Running tests in IntelliJ
~~~~~~~~~~~~~~~~~~~~~~~~~
We recommend editing your IntelliJ preferences so that you use the Gradle runner - this means that the quasar utils
plugin will make sure that some flags (like ``-javaagent`` - see :ref:`below <tutorial_cordapp_alternative_test_runners>`) are
set for you.
To switch to using the Gradle runner:
* Navigate to ``Build, Execution, Deployment -> Build Tools -> Gradle -> Runner`` (or search for `runner`)
* Windows: this is in "Settings"
* MacOS: this is in "Preferences"
* Set "Delegate IDE build/run actions to gradle" to true
* Set "Run test using:" to "Gradle Test Runner"
.. _tutorial_cordapp_alternative_test_runners:
If you would prefer to use the built in IntelliJ JUnit test runner, you can add some code to your ``build.gradle`` file and
it will copy your quasar JAR file to the lib directory. You will also need to specify ``-javaagent:lib/quasar.jar``
and set the run directory to the project root directory for each test.
Add the following to your ``build.gradle`` file - ideally to a ``build.gradle`` that already contains the quasar-utils plugin line:
.. sourcecode:: groovy
apply plugin: 'net.corda.plugins.quasar-utils'
task installQuasar(type: Copy) {
destinationDir rootProject.file("lib")
from(configurations.quasar) {
rename 'quasar-core(.*).jar', 'quasar.jar'
}
}
and then you can run ``gradlew installQuasar``.
Debugging your CorDapp
----------------------