CORDA-2821 Fix issue with Quasar errors redirecting to useless page (#4982)

* Changed dead url to the new location.

* Modified documentation. Linked new place for intelliJ guide.

* Changed url to the new link.
This commit is contained in:
Stefan Iliev 2019-04-25 16:34:05 +01:00 committed by Katelyn Baker
parent b4ba2ca4c1
commit 1128156153
3 changed files with 46 additions and 36 deletions

View File

@ -33,3 +33,47 @@ as follows:
How to manually test each of these areas differs and is currently not fully specified. For now the best thing to do is to ensure the
program starts, that you can interact with it, and that no exceptions are generated in normal operation.
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.
.. note:: Before creating the IntelliJ run configurations for these unit tests
go to Run -> Edit Configurations -> Defaults -> JUnit, add
``-javaagent:lib/quasar.jar``
to the VM options, and set Working directory to ``$PROJECT_DIR$``
so that the ``Quasar`` instrumentation is correctly configured.
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``.

View File

@ -486,41 +486,7 @@ You can run the CorDapp's integration tests by running the ``Run Integration Tes
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``.
See :ref:`Running tests in IntelliJ<tutorial_cordapp_alternative_test_runners>`
Debugging your CorDapp
----------------------

View File

@ -309,7 +309,7 @@ class SingleThreadedStateMachineManager(
private fun checkQuasarJavaAgentPresence() {
check(SuspendableHelper.isJavaAgentActive()) {
"""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.""".trimMargin("#")
#See https://docs.corda.net/head/testing.html#running-tests-in-intellij - 'Fiber classes not instrumented' for more details.""".trimMargin("#")
}
}