Dynamic Directories

When managing files and folders during a test, MUnit provides the munit.temporary.directory property to reference a temporary directory. You can create files and folders inside this directory to use in your tests.

The temporary directory is deleted at the end of each test.

For example, using the file connector, you could configure the working directory as follows:

<file:config name="tmpDir">
    <file:connection workingDir="${munit.temporary.directory}"/>

And then use it to create files/folders inside it:

<file:create-directory config-ref="tmpDir" directoryPath="example"/>

See Also

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub
Give us your feedback!
We want to build the best documentation experience for you!
Help us improve with your feedback.
Take the survey!