-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added documentation for the Camunda Platform 8 support (#175)
- Loading branch information
Showing
3 changed files
with
326 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
# Gradle Plugin for Camunda 8 | ||
The plugin `org.camunda.community.bpmndt` registers the Gradle task `generateTestCases`. | ||
It generates the test code under `build/bpmndt` and adds this directory as test source directory, which is automatically compiled before the `compileTestJava` task of Gradle's Java plugin. | ||
The compilation results (test cases and [API classes](../impl-8/src/main/java/org/camunda/community/bpmndt/api)) will be available in the test classpath afterwards. | ||
|
||
:warning: Within **Eclipse**, the Gradle task `generateTestCases` must be executed manually to generate the test cases: | ||
|
||
1. Create a new Gradle task configuration via `Run` > `Run Configurations...` > `Gradle Task` > `New Configuration` | ||
2. Choose the working directory via `Workspace...` | ||
3. Add the `generateTestCases` task | ||
4. Run the Gradle task configuration | ||
|
||
:warning: Within **IntelliJ IDEA**, the Gradle task `generateTestCases` must be executed manually to generate the test cases - see [Run Gradle tasks](https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#gradle_tasks): | ||
|
||
1. Type | ||
|
||
``` | ||
<CTRL><CTRL> | ||
gradle generateTestCases | ||
``` | ||
|
||
2. Right click the `build/bpmndt` test sources folder and perform a `Reload from Disk` | ||
|
||
## Usage | ||
|
||
In `settings.gradle`, define the plugin and a resolution strategy, since the plugin is provided as a Maven artfiact via Maven Central: | ||
|
||
```groovy | ||
pluginManagement { | ||
plugins { | ||
id 'org.camunda.community.bpmndt' | ||
} | ||
resolutionStrategy { | ||
eachPlugin { | ||
if (requested.id.toString() == 'org.camunda.community.bpmndt') { | ||
useModule("org.camunda.community:bpmn-driven-testing-8-gradle-plugin:0.11.0") | ||
} | ||
} | ||
} | ||
repositories { | ||
mavenCentral() | ||
} | ||
} | ||
``` | ||
|
||
In `build.gradle`, add the plugin beside the `java` Gradle plugin: | ||
|
||
```groovy | ||
plugins { | ||
id 'java' | ||
id 'org.camunda.community.bpmndt' | ||
} | ||
``` | ||
|
||
Please see [Maven Central](https://central.sonatype.com/artifact/org.camunda.community/bpmn-driven-testing-8-gradle-plugin/0.11.0/versions) to get a specific version. | ||
|
||
## Configuration | ||
Available properties: | ||
|
||
| Parameter | Type | Description | Default value | | ||
|:---------------------|:-------------|:---------------------------------------------------------------------------|:--------------| | ||
| packageName | String | Package name, used for the generated test sources | generated | | ||
|
||
The plugin's configuration is done in `build.gradle` within the `bpmndt` extension element: | ||
|
||
```groovy | ||
bpmndt { | ||
packageName = 'generated' | ||
} | ||
``` | ||
|
||
## Dependencies | ||
Add dependencies, which are required to execute the generated test code: | ||
|
||
```groovy | ||
dependencies { | ||
testImplementation 'io.camunda:zeebe-process-test-extension:8.4.4' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.1' | ||
testCompileOnly 'org.immutables:annotate:2.10.0' | ||
testCompileOnly 'org.immutables:value-annotations:2.10.0' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.1' | ||
} | ||
test { | ||
useJUnitPlatform() | ||
} | ||
``` | ||
|
||
Recommended versions: | ||
|
||
| Dependency | Version | | ||
|:-----------------------------|:--------| | ||
| Zeebe Process Test Extension | 8.4.4 | | ||
| JUnit 5 (Jupiter) | 5.10.1 | | ||
|
||
## Testing | ||
:warning: This sections are only important for Gradle plugin development! | ||
|
||
Beside unit tests, a set of [integration tests](../integration-tests-8) exist, | ||
which verify that the Gradle plugin works correctly when executed within a Gradle build. | ||
The integration tests are implemented using the [Robot Framework](https://robotframework.org/) (Java implementation). | ||
|
||
To execute unit and integration tests, run: | ||
|
||
``` | ||
mvn clean integration-test | ||
``` | ||
|
||
The Robot test report is written to `target/robot/report.html`. |
Oops, something went wrong.