8

We are looking for a framework to test our MarkLogic XQuery code.

We can see MarkLogic/XQunit is a good framework, but it does not have code coverage feature.

What is the best framework to write unit test cases for MarkLogic XQuery?

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147

1 Answers1

15

Two unit test frameworks I've seen used in practice are XRay and Roxy Unit Test (note that Roxy Unit Test is part of a larger project, consisting of the Roxy Deployer, MVC structure, and Unit Test; the Unit Test feature will be easiest to use if you're also using the Deployer). Roxy can test XQuery and Server-side JavaScript code.

I'm not aware of any tool that provides code coverage at this time.

Edit: Rob Rudin has made the Roxy Unit Test framework more accessible to gradle projects: https://github.com/marklogic-community/ml-unit-test.

Edit 2: ml-unit-test now offers an experimental code-coverage feature

Dave Cassel
  • 8,352
  • 20
  • 38
  • 1
    There is also xqtest https://github.com/irinc/xqtest. I do prefer Xray over xqtest and only use Roxy Unit testing when I'm already using roxy in my project. – Tyler Replogle Apr 01 '15 at 03:53
  • 2
    xray has an experimental code coverage branch: https://github.com/robwhitby/xray/tree/v2.1 – mblakele Apr 01 '15 at 19:13