marklogic-unit-test includes the original Roxy unit test framework for MarkLogic and provides a few new features:
- A REST endpoint for listing and running unit tests
- A small Java library for integrating MarkLogic unit tests into existing test frameworks like JUnit
- The ability to depend on this module as a true third-party dependency via ml-gradle
To try this out locally, check out the ml-gradle example project. You can use that project's build.gradle file as an example of how to use marklogic-unit-test in your own project.
Contributions are welcome. Here are some steps to get you started:
- Please start by forking the project on GitHub
- Check out your fork of the project
- Make your changes
- Add tests to cover your changes
- Make sure the tests pass by running
gradle build test
- Check in your changes to your fork on GitHub
- Once the changes are ready, create a pull request
- Wait for the pull request to be reviewed and accepted into the baseline
Please make sure that all changes to the project include sufficient unit tests to cover the feature being added. Pull requests without automated tests will not be accepted.
Tests can be added to {PROJECT}/marklogic-unit-test-client/src/test/ml-modules/root/test/suites
and can be ran with
the gradle build test
target.
If you're using an IDE with Junit support tests can be ran from the IDE by running the test at
{PROJECT}/marklogic-unit-test-client/src/test/java/com/marklogic/test/unit/ParameterizedTest.java
To do a release:
- Increment the
version
property in{PROJECT}/gradle.properties
- In
{PROJECT}/
, rungithub_changelog_generator --token $your-github-token --future-release v1.0.0
- If running on Windows, you'll need to use different cache file paths, such as
--cache-file C:\tmp\github-changelog-http-cache --cache-log C:\tmp\github-changelog-logger.log
.
- If running on Windows, you'll need to use different cache file paths, such as
- Commit the CHANGELOG.md
- Push changes to GitHub
- Do a PR to bring changes from the develop branch onto master
- Follow the steps on creating releases.
To publish this project, you need to publish both marklogic-unit-test-modules and marklogic-unit-test-client.
- In
{PROJECT}/gradle.properties
, add these propertiesmyBintrayUser
,myBintrayKey
cd marklogic-unit-test-client
gradle bintrayUpload
cd ../marklogic-unit-test-modules
gradle bintrayUpload
- Open marklogic-unit-test-modules on Bintray and click "Publish"
- Open marklogic-unit-test-client on Bintray and click "Publish"