Skip to content

Commit 7b093eb

Browse files
committed
editorial
1 parent 719a3e6 commit 7b093eb

2 files changed

Lines changed: 52 additions & 68 deletions

File tree

modules/ROOT/pages/munit-extensions-maven-plugin-configuration.adoc

Lines changed: 40 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -44,24 +44,22 @@ To enable runtime discovery, add the following configuration to the MUnit Extens
4444
...
4545
<runtimeConfiguration>
4646
<discoverRuntimes>
47-
<product>CE</product> //<1>
47+
<product>`Product`</product> //<1>
4848
</discoverRuntimes>
4949
</runtimeConfiguration>
5050
...
5151
</configuration>
5252
</plugin>
5353
</plugins>
5454
----
55-
[calloutlist]
56-
.. This enables the runtime discovery feature for all released CE runtimes.
5755

58-
From the command line, the property is `discoverRuntimes.product`.
56+
The `Product` can be CE (Community Edition), EE (Enterprise Edition), or ALL (both CE and EE). For example, if the `Product` is CE, the runtime discovery feature is enabled for all released CE runtimes.
5957

60-
NOTE: The `product` can be CE (Community Edition), EE (Enterprise Edition), or ALL (both CE and EE).
58+
From the command line, use the `discoverRuntimes.product` property to enable runtime discovery.
6159

6260
=== Include Snapshots
6361

64-
To include snapshot versions of Mule runtime, add the following line to the runtime configuration:
62+
To include snapshot versions of Mule runtime, add an `includeSnapshots` property to the runtime configuration:
6563

6664
[source,xml,linenums]
6765
----
@@ -73,11 +71,11 @@ To include snapshot versions of Mule runtime, add the following line to the runt
7371
</runtimeConfiguration>
7472
----
7573

76-
From the command line, the property is `discoverRuntimes.includeSnapshots`. The default value is `false`.
74+
From the command line, use the `discoverRuntimes.includeSnapshots` property to include snapshots. The default value is `false`.
7775

7876
=== Discover Only the Latest Patches
7977

80-
To discover only the latest patch versions of Mule runtime, add the following line to the runtime configuration:
78+
To discover only the latest patch versions of Mule runtime, add a `latestPatches` property to the runtime configuration:
8179

8280
[source,xml,linenums]
8381
----
@@ -89,11 +87,11 @@ To discover only the latest patch versions of Mule runtime, add the following li
8987
</runtimeConfiguration>
9088
----
9189

92-
From the command line, the property is `discoverRuntimes.latestPatches`. The default value is `true`.
90+
From the command line, use the `discoverRuntimes.latestPatches` property to discover only the latest patches. The default value is `true`.
9391

9492
=== Discover Since a Minimum Version
9593

96-
By default, runtime discovery searches for all Mule runtime versions since the `minMuleVersion` of the module. To change this minimum version, add the following line to the runtime configuration:
94+
By default, runtime discovery searches for all Mule runtime versions since the `minMuleVersion` of the module. To change the minimum version, add a `minMuleVersion` property to the runtime configuration:
9795

9896
[source,xml,linenums]
9997
----
@@ -105,11 +103,11 @@ By default, runtime discovery searches for all Mule runtime versions since the `
105103
</runtimeConfiguration>
106104
----
107105

108-
From the command line, the property is `discoverRuntimes.minMuleVersion`. The default value is the `minMuleVersion` of the module.
106+
From the command line, use the `discoverRuntimes.minMuleVersion` property to discover runtimes since a minimum version. The default value is the `minMuleVersion` of the module.
109107

110108
=== Run Against Additional Runtimes
111109

112-
By default, the MUnit Extensions Maven plugin runs against the `minMuleVersion` and the required product of the module. To specify additional runtimes to run against, add the following lines to the runtime configuration:
110+
By default, the MUnit Extensions Maven plugin runs against the `minMuleVersion` and the required product of the module. To specify additional runtimes to run against, add `additionalRuntime` properties to the runtime configuration:
113111

114112
[source,xml,linenums]
115113
----
@@ -121,11 +119,11 @@ By default, the MUnit Extensions Maven plugin runs against the `minMuleVersion`
121119
</runtimeConfiguration>
122120
----
123121

124-
From the command line, the property is `additionalRuntimes`.
122+
From the command line, use the `additionalRuntimes` property to run against additional runtimes.
125123

126124
=== Skip Runtime Discovery
127125

128-
To skip runtime discovery, add the following line to the runtime configuration:
126+
To skip runtime discovery, add a `skip` property to the runtime configuration:
129127

130128
[source,xml,linenums]
131129
----
@@ -137,28 +135,24 @@ To skip runtime discovery, add the following line to the runtime configuration:
137135
</runtimeConfiguration>
138136
----
139137

140-
From the command line, the property is `discoverRuntimes.skip`. The default value is `false`.
138+
From the command line, use the `discoverRuntimes.skip` property to skip runtime discovery. The default value is `false`.
141139

142140
== Use Dynamic Ports
143141

144142
[IMPORTANT]
145143
MUnit 2.2 and later introduces the `dynamic-port` global element, which you can use to define dynamic ports at the MUnit suite level. +
146-
Use this element instead of the plugin configuration described below to set the dynamic port both from Maven and Studio. +
144+
Use this element instead of the plugin configuration described below to set the dynamic port from both Maven and Studio. +
147145
For more information about how to configure this element, refer to xref:munit::dynamic-ports.adoc[Dynamic Ports].
148146

149147
When testing a module in a continuous integration (CI) environment, you might encounter the following scenario:
150148

151149
`Your test tries to open a specific port. The port is already in use. The test fails with a port binding exception.`
152150

153-
To solve this, use the dynamic ports built-in feature in the MUnit Extensions Maven plugin to have your test use a free port. Dynamic ports instruct the MUnit Extensions Maven plugin to look for unbound ports and reserves them before running the tests over the module. Each port selected is placed in a system property under the name indicated in the configuration. The test can acquire the port number through the use of placeholders afterward.
151+
To solve this, use the dynamic ports built-in feature in the MUnit Extensions Maven plugin to have your test use a free port. Dynamic ports instruct the MUnit Extensions Maven plugin to look for unbound ports and reserves them before running the tests over the module. Each selected port is placed in a system property under the name indicated in the configuration. The test can acquire the port number through the use of placeholders afterward.
154152

155-
TIP: The ports to select by the MUnit Extensions Maven plugin are taken from the following range: `[40000,50000)`.
153+
The ports that the MUnit Extensions Maven plugin can select are in the following range: `[40000,50000)`.
156154

157-
[CAUTION]
158-
--
159-
The dynamic ports feature is available only as part of the MUnit Extensions Maven Plugin. +
160-
You can't expect this feature to work when running tests from inside Anypoint Studio.
161-
--
155+
The dynamic ports feature is available only as part of the MUnit Extensions Maven plugin. This feature doesn't work when running tests from inside Anypoint Studio.
162156

163157
=== Enable Dynamic Ports
164158

@@ -192,20 +186,20 @@ If you have the `${http.port}` placeholder in your test, the configuration looks
192186

193187
== Disable Surefire Reports
194188

195-
MUnit has built-in support for Surefire. No additional configuration is needed but it can be disabled if not needed.
189+
MUnit has built-in support for Surefire. You can disable this support if it's not needed.
196190

197191
[source,xml,linenums]
198192
----
199193
<enableSurefireReports>false</enableSurefireReports>
200194
----
201195

202-
The reports can be found under `${project.build.directory}/surefire-reports`.
196+
The reports are located under `${project.build.directory}/surefire-reports`.
203197

204198
The default value is `true`.
205199

206200
== Run Specific Tests
207201

208-
To run specific tests, add a line for the specific test:
202+
To run a specific test, add an `munitTest` property for each specific test to the configuration section of the MUnit Extensions Maven plugin:
209203

210204
[source,xml,linenums]
211205
----
@@ -224,7 +218,7 @@ To run specific tests, add a line for the specific test:
224218

225219
== Run Tests with Specific Tags
226220

227-
To run tests with specific tags, add a line for the test with the specific tag:
221+
To run tests with specific tags, add an `munitTags` property for the test with the specific tag to the configuration section of the MUnit Extensions Maven plugin. Separate the tags with commas:
228222

229223
[source,xml,linenums]
230224
----
@@ -234,18 +228,16 @@ To run tests with specific tags, add a line for the test with the specific tag:
234228
<artifactId>munit-extensions-maven-plugin</artifactId>
235229
<configuration>
236230
...
237-
<munitTags>exampleMunitTag</munitTags>
231+
<munitTags>exampleMunitTag,exampleMunitTag2</munitTags>
238232
...
239233
</configuration>
240234
</plugin>
241235
</plugins>
242236
----
243237

244-
You can specify more than one tag by separating them with a comma.
245-
246238
== Skip MUnit Tests
247239

248-
To skip MUnit tests, add a line to skip MUnit tests:
240+
To skip MUnit tests, add a `skipMunitTests` property to skip MUnit tests to the configuration section of the MUnit Extensions Maven plugin:
249241

250242
[source,xml,linenums]
251243
----
@@ -264,7 +256,7 @@ To skip MUnit tests, add a line to skip MUnit tests:
264256

265257
== Skip Tests After One Suite Fails
266258

267-
To skip the rest of the tests if one test suite fails, add a line to skip after failure:
259+
To skip the rest of the tests if one test suite fails, add a `skipAfterFailure` property to skip after failure to the configuration section of the MUnit Extensions Maven plugin:
268260

269261
[source,xml,linenums]
270262
----
@@ -285,7 +277,7 @@ The default value is `false`.
285277

286278
== Specify the Mule Runtime Version
287279

288-
To specify the Mule runtime version that your tested module runs on, add a line for the Mule runtime version:
280+
To specify the Mule runtime version that your tested module runs on, add a `runtimeVersion` property for the Mule runtime version to the configuration section of the MUnit Extensions Maven plugin:
289281

290282
[source,xml,linenums]
291283
----
@@ -302,13 +294,13 @@ To specify the Mule runtime version that your tested module runs on, add a line
302294
</plugins>
303295
----
304296

305-
WARNING: If this option is set, runtime discovery and `additionalRuntimes` don't take effect.
297+
If this option is set, runtime discovery and `additionalRuntimes` don't take effect.
306298

307299
== Specify the Runtime Product
308300

309301
You can specify the type of runtime that your tested module runs on.
310302

311-
The two possible values are `MULE` for Community Edition, and `MULE_EE` for Enterprise Edition.
303+
Values are `MULE` for Community Edition, and `MULE_EE` for Enterprise Edition.
312304

313305
[source,xml,linenums]
314306
----
@@ -325,11 +317,11 @@ The two possible values are `MULE` for Community Edition, and `MULE_EE` for Ente
325317
</plugins>
326318
----
327319

328-
WARNING: If this option is set, runtime discovery and `additionalRuntimes` don't take effect.
320+
If this option is set, runtime discovery and `additionalRuntimes` don't take effect.
329321

330322
== Specify the JVM
331323

332-
You can specify the JVM (or the Java executable) that your tested module runs on. Populate the property with the path to the executable.
324+
To specify the JVM (Java executable) that your tested module runs on, populate the `jvm` property with the path to the executable:
333325

334326
[source,xml,linenums]
335327
----
@@ -346,7 +338,7 @@ You can specify the JVM (or the Java executable) that your tested module runs on
346338
</plugins>
347339
----
348340

349-
From the command line, the property is `-Dmunit.jvm`.
341+
From the command line, use the `-Dmunit.jvm` property to specify the JVM.
350342

351343
== Set Environment Variables
352344

@@ -370,11 +362,11 @@ To set additional environment variables during the test run, specify them with t
370362
</plugins>
371363
----
372364

373-
Use environment variables to replace placeholders such as `${MY_ENV}` (from the example above).
365+
Use environment variables to replace `${MY_ENV}` and `${MY_OTHER_ENV}`.
374366

375367
== Redirect Test Output to a File
376368

377-
When running several tests, the build output can be complicated to read. You can redirect the build output of each test suite to a file so the build output contains the test results and the respective file contains standard output of each test suite.
369+
When running several tests, the build output can be complicated to read. You can redirect the build output of each test suite to a file so that the build output contains the test results and the respective file contains the standard output of each test suite.
378370

379371
These files are located in the `testOutputDirectory` folder and follow the `munit.${suiteName}-output.txt` naming convention, in which `suiteName` is the name of the XML file relative to the MUnit test folder.
380372

@@ -418,24 +410,18 @@ You can define specific system variables needed for your MUnit test to run succe
418410
</plugins>
419411
----
420412

421-
[TIP]
422-
====
423413
Depending on the execution context, the system properties values might vary. When referencing these properties, override their value to enforce test reproducibility.
424414

425415
You can do so by using the ­`-D` argument when running MUnit with Maven. +
426-
Variables passed with the `-D` argument take full priority over any other property.
427-
428-
For example:
429-
430-
`-Dmy.property.key=my.property.another.value`
431-
====
416+
Variables passed with the `-D` argument take full priority over any other property, for example, `-Dmy.property.key=my.property.another.value`.
432417

433418
== Test Output Directory
434419

435420
You can choose the location where the test output files are created.
436421
The specified path can be an absolute path or a Maven placeholder.
437422

438-
.Test output directory with an absolute path
423+
If the specified path is an absolute path, the test output directory looks like this:
424+
439425
[source,xml,linenums]
440426
----
441427
<plugins>
@@ -451,7 +437,8 @@ The specified path can be an absolute path or a Maven placeholder.
451437
</plugins>
452438
----
453439

454-
.Test output directory with a Maven placeholder
440+
If the specified path is a Maven placeholder, the test output directory looks like this:
441+
455442
[source,xml,linenums]
456443
----
457444
<testOutputDirectory>${project.build.directory}/my/output/folder</testOutputDirectory>
@@ -462,7 +449,7 @@ By default, the files are created in `${project.build.directory}/munit-reports/o
462449
== Specify Shared Libraries
463450

464451
When requiring external libraries (as explained in xref:external-libs.adoc[]), specify
465-
these libraries as `sharedLibraries` (apart from having the corresponding dependencies in the project).
452+
these libraries as `sharedLibraries`. You must also have the corresponding dependencies in the project.
466453

467454
For example, if you define the following external library in your module:
468455

@@ -497,7 +484,7 @@ You must configure the plugin in the following way:
497484

498485
== Import External Suites and Resources
499486

500-
To reuse suite files that are present in an external artifact across different modules, include the suite files in the configuration as if they are present in the `src/test/munit` and `src/test/resources` folders. Ensure you add the dependencies in the plugin's classpath.
487+
To reuse suite files that are present in an external artifact across different modules, include the suite files in the configuration as if they are present in the `src/test/munit` and `src/test/resources` folders. Ensure that you add the dependencies in the plugin's classpath.
501488

502489
[source,xml,linenums]
503490
----
@@ -527,7 +514,7 @@ To reuse suite files that are present in an external artifact across different m
527514
</plugins>
528515
----
529516

530-
If any of the suite files or resources are not present in the classpath, the plugin fails.
517+
If any of the suite files or resources aren't present in the classpath, the plugin fails.
531518

532519
== See Also
533520

0 commit comments

Comments
 (0)