|
1 | | -# MarkLogic Unit Test |
| 1 | + |
| 2 | + |
| 3 | +[](https://opensource.org/licenses/Apache-2.0) |
| 4 | +# Testing MarkLogic |
2 | 5 |
|
3 | | -marklogic-unit-test includes the [original Roxy unit test framework for MarkLogic](https://github.com/marklogic-community/roxy/wiki/Unit-Testing) and |
4 | | -provides a few new features: |
| 6 | +marklogic-unit-test is an [ml-gradle bundle](https://github.com/marklogic-community/ml-gradle/wiki/Bundles) that allows |
| 7 | +a project to test MarkLogic code. With one import a project immediately has access to: |
5 | 8 |
|
6 | | -1. A REST endpoint for listing and running unit tests |
7 | | -1. A small Java library for integrating MarkLogic unit tests into existing test frameworks like JUnit |
8 | | -1. The ability to depend on this module as a true third-party dependency via ml-gradle |
| 9 | +1. A framework for writing and running MarkLogic unit tests, including several built in assertion functions |
| 10 | +1. A UI for viewing and running unit tests entirely within MarkLogic |
| 11 | +1. A REST endpoint to run and report unit tests with other tools |
9 | 12 |
|
10 | | -To try this out locally, check out the |
11 | | -[ml-gradle example project](https://github.com/marklogic-community/ml-gradle/tree/dev/examples/unit-test-project). |
12 | | -You can use that project's build.gradle file as an example of how to use marklogic-unit-test in your own project. |
13 | | - |
14 | | -# Contributing |
15 | | - |
16 | | -Contributions are welcome. Here are some steps to get you started: |
17 | | -1. Please start by forking the project on GitHub |
18 | | -1. Check out your fork of the project |
19 | | -1. Make your changes |
20 | | -1. Add tests to cover your changes |
21 | | -1. Make sure the tests pass by running `gradle build test` |
22 | | -1. Check in your changes to your fork on GitHub |
23 | | -1. Once the changes are ready, create a pull request |
24 | | -1. Wait for the pull request to be reviewed and accepted into the baseline |
25 | | - |
26 | | -## Testing |
27 | | -Please make sure that all changes to the project include sufficient unit tests to cover the feature being added. Pull |
28 | | -requests without automated tests will not be accepted. |
29 | | - |
30 | | -Tests can be added to `{PROJECT}/marklogic-unit-test-client/src/test/ml-modules/root/test/suites` and can be ran with |
31 | | -the `gradle build test` target. |
| 13 | +Testing MarkLogic from a Java project is made easy with marklogic-junit: |
32 | 14 |
|
33 | | -If you're using an IDE with Junit support tests can be ran from the IDE by running the test at |
34 | | -`{PROJECT}/marklogic-unit-test-client/src/test/java/com/marklogic/test/unit/ParameterizedTest.java` |
| 15 | +1. Write MarkLogic tests entirely from Java |
| 16 | +1. Easily integrate MarkLogic unit tests into your favorite Java testing frameworks |
35 | 17 |
|
36 | | -## Releasing |
| 18 | +# Start using marklogic-unit-test |
37 | 19 |
|
38 | | -To do a release: |
39 | | - |
40 | | -1. Increment the `version` property in `{PROJECT}/gradle.properties` |
41 | | -2. In `{PROJECT}/`, run `github_changelog_generator --token $your-github-token --future-release v1.0.0` |
42 | | - - If running on Windows, you'll need to use different cache file paths, such as |
43 | | - `--cache-file C:\tmp\github-changelog-http-cache --cache-log C:\tmp\github-changelog-logger.log`. |
44 | | -3. Commit the CHANGELOG.md |
45 | | -4. Push changes to GitHub |
46 | | -5. Do a PR to bring changes from the develop branch onto master |
47 | | -6. Follow the steps on [creating releases](https://help.github.com/articles/creating-releases/). |
48 | | - |
49 | | -### Publishing to bintray |
50 | | - |
51 | | -To publish this project, you need to publish both marklogic-unit-test-modules and marklogic-unit-test-client. |
| 20 | +If you'd like to use marklogic-unit-test check out this |
| 21 | +[ml-gradle example project](https://github.com/marklogic-community/ml-gradle/tree/dev/examples/unit-test-project). |
| 22 | +You can use that project's build.gradle file as an example of how to use marklogic-unit-test in your own project. |
52 | 23 |
|
53 | | -1. In `{PROJECT}/gradle.properties`, add these properties `myBintrayUser`, `myBintrayKey` |
54 | | -2. `cd marklogic-unit-test-client` |
55 | | -3. `gradle bintrayUpload` |
56 | | -4. `cd ../marklogic-unit-test-modules` |
57 | | -5. `gradle bintrayUpload` |
58 | | -6. Open [marklogic-unit-test-modules](https://bintray.com/marklogic-community/Maven/marklogic-unit-test-modules) on |
59 | | -Bintray and click "Publish" |
60 | | -6. Open [marklogic-unit-test-client](https://bintray.com/marklogic-community/Maven/marklogic-unit-test-client) on |
61 | | -Bintray and click "Publish" |
| 24 | +# Start using marklogic-junit |
| 25 | +Check out the [marklogic-junit sub-project](https://github.com/marklogic-community/marklogic-unit-test/tree/master/marklogic-junit) |
| 26 | +to get started using marklogic-junit. |
0 commit comments