mirror of
https://github.com/corda/corda.git
synced 2025-06-14 13:18:18 +00:00
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:
committed by
Anthony Keenan
parent
2e4c5d79f6
commit
b0a9656746
@ -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
|
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.
|
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``.
|
@ -484,41 +484,7 @@ You can run the CorDapp's integration tests by running the ``Run Integration Tes
|
|||||||
Running tests in IntelliJ
|
Running tests in IntelliJ
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
We recommend editing your IntelliJ preferences so that you use the Gradle runner - this means that the quasar utils
|
See :ref:`Running tests in IntelliJ<tutorial_cordapp_alternative_test_runners>`
|
||||||
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
|
Debugging your CorDapp
|
||||||
----------------------
|
----------------------
|
||||||
|
@ -309,7 +309,7 @@ class SingleThreadedStateMachineManager(
|
|||||||
private fun checkQuasarJavaAgentPresence() {
|
private fun checkQuasarJavaAgentPresence() {
|
||||||
check(SuspendableHelper.isJavaAgentActive()) {
|
check(SuspendableHelper.isJavaAgentActive()) {
|
||||||
"""Missing the '-javaagent' JVM argument. Make sure you run the tests with the Quasar java agent attached to your JVM.
|
"""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("#")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user