Skip to content

Commit c7f8cc8

Browse files
authored
Merge pull request #203 from marklogic-community/feature/docs-fix
Fixing links in docs
2 parents 4681ba2 + dbab4d8 commit c7f8cc8

File tree

11 files changed

+20
-23
lines changed

11 files changed

+20
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ out
1010
marklogic-unit-test-client/bin/
1111
gradle-local.properties
1212
.vscode
13+
bin

docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ _site
33
.jekyll-cache
44
.jekyll-metadata
55
vendor
6+
.ruby-version

docs/Gemfile.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ GEM
251251

252252
PLATFORMS
253253
arm64-darwin-21
254+
arm64-darwin-23
254255

255256
DEPENDENCIES
256257
github-pages (~> 228)

docs/assertion-functions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
layout: default
33
title: Assertion functions
44
nav_order: 7
5-
permalink: /docs/assertions
65
---
76

87
The list below captures the assertion functions available in the marklogic-unit-test `/test/test-helper.xqy` module.

docs/debugging-tests.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
layout: default
33
title: Debugging tests
44
nav_order: 5
5-
permalink: /docs/debugging
65
---
76

87
Like all unit testing frameworks, marklogic-unit-test is intended to speed up the cycle of developing, testing, and
@@ -13,7 +12,7 @@ team.
1312
## Development setup
1413

1514
Before looking at how to write tests, you should ensure that you can change your application code and test the
16-
changes as quickly as possible. As mentioned in the [Getting started guide](/docs), ml-gradle supports
15+
changes as quickly as possible. As mentioned in the [Getting started guide](getting-started.md), ml-gradle supports
1716
[watching for module changes](https://github.com/marklogic/ml-gradle/wiki/Watching-for-module-changes) so that when
1817
you modify either an application module file or test module file, the file will be immediately loaded into your
1918
application's modules database. This allows you to test your changes as quickly as possible.
@@ -27,7 +26,7 @@ MarkLogic.
2726

2827
## Test assertion messages
2928

30-
Each [assertion function](/docs/assertions) in marklogic-unit-test supports an assertion message as its final argument.
29+
Each [assertion function](assertion-functions.md) in marklogic-unit-test supports an assertion message as its final argument.
3130
These are recommended for when the intent of an assertion is not readily apparent from the two values being compared.
3231

3332
For example, consider the following assertion:

docs/getting-started.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
layout: default
33
title: Getting started
44
nav_order: 2
5-
permalink: /docs
65
---
76

87
This guide walks you through adding marklogic-unit-test to an existing project, followed by writing, loading, and
@@ -40,7 +39,7 @@ in your `build.gradle` file), run the following task to install marklogic-unit-t
4039

4140
./gradlew -i mlLoadModules
4241

43-
If you would like to [run your marklogic-unit-test tests](/docs/running) via Gradle, you'll also need to include the
42+
If you would like to [run your marklogic-unit-test tests](running-tests.md) via Gradle, you'll also need to include the
4443
following at the top of your `build.gradle` file:
4544

4645
```
@@ -90,7 +89,7 @@ therefore be stored in the `src/test/ml-modules/root/test/suites/(name of suite)
9089

9190
A test suite can have any name; for this example, we will use "thesaurus" as the name. Test modules can have any name
9291
as well with a few exceptions for setup and teardown modules; those exceptions are covered in the
93-
[guide for writing tests](/docs/writing). We will use "simple-test.sjs" for this example, so we create a
92+
[guide for writing tests](writing-tests.md). We will use "simple-test.sjs" for this example, so we create a
9493
file at `src/test/ml-modules/root/test/suites/thesaurus/simple-test.sjs` with the following initial content:
9594

9695
```
@@ -99,7 +98,7 @@ const lib = require("/example/lib.sjs");
9998
```
10099

101100
The first line above imports the marklogic-unit-test module containing dozens of useful
102-
[assertion functions](/docs/assertions); every test
101+
[assertion functions](assertion-functions.md); every test
103102
module will need this imported. The second line imports the library module that we wish to verify.
104103

105104
Next, add the following text to the file:
@@ -116,7 +115,7 @@ const result = lib.lookupTerm("Car");
116115
The above code will invoke the `lookupTerm` function that we wish to test with a term that we know is in the
117116
application's thesaurus. Each `assertEqual` function call - along with every other assertion function in
118117
marklogic-unit-test - will return a success or failure. The test then returns an array of these successes and failures.
119-
The different approaches for [running tests](/docs/running) know how to collect these results and display how many
118+
The different approaches for [running tests](running-tests.md) know how to collect these results and display how many
120119
tests passed and how many failed.
121120

122121
## Configuring a connection to MarkLogic
@@ -163,7 +162,7 @@ Once you execute either `mlWatch` or `mlLoadModules`, your test will be ready to
163162

164163
## Running a test
165164

166-
marklogic-unit-test provides [several ways to run tests](/docs/running). We will look at the two primary ways to
165+
marklogic-unit-test provides [several ways to run tests](running-tests.md). We will look at the two primary ways to
167166
run the test module we just wrote and loaded into our application's modules database.
168167

169168
First, tests can be run via the ml-gradle `mlUnitTest` task, as long as you have included the
@@ -217,6 +216,6 @@ This guide has covered the following topics:
217216
3. How to load a test.
218217
4. How to run a test.
219218

220-
With the above information and the references on [writing tests](/docs/writing) and
221-
[running tests](/docs/running), you can now start writing tests for the library modules in your application,
219+
With the above information and the references on [writing tests](writing-tests.md) and
220+
[running tests](running-tests.md), you can now start writing tests for the library modules in your application,
222221
ensuring that you can quickly enhance your application without breaking any existing functionality.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ marklogic-unit-test includes the following components:
1919
popular Java testing frameworks.
2020
4. A REST endpoint for integrating with testing frameworks in any language.
2121

22-
Please see the [Getting started guide](/docs) to learn how to include marklogic-unit-test in your
22+
Please see the [Getting started guide](getting-started.md) to learn how to include marklogic-unit-test in your
2323
project and to start writing and running tests.
2424

2525
If you have any questions or run into issues while using marklogic-unit-test, try one of the following:

docs/loading-test-data.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
layout: default
33
title: Loading test data
44
nav_order: 6
5-
permalink: /docs/loading
65
---
76

87
marklogic-unit-test includes a simple mechanism for loading test data specific to a test suite. This capability is
@@ -33,7 +32,7 @@ test:load-test-file("sample-doc.json", xdmp:database(), "/sample-doc.json")
3332
```
3433

3534
The above examples can also be implemented in either `suiteSetup.sjs` or `suite-setup.xqy` if desired - see the
36-
[guide on writing tests](/docs/writing) for more information on setup and teardown modules.
35+
[guide on writing tests](writing-tests.md) for more information on setup and teardown modules.
3736

3837
You can also use a teardown module to delete the data that was loaded. However, leaving data in place after a test
3938
concludes is often helpful for both manually verifying what it's in the database and for debugging test failures.

docs/running-tests.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
layout: default
33
title: Running tests
44
nav_order: 4
5-
permalink: /docs/running
65
---
76

87
Tests written using marklogic-unit-test can be run in several ways, each of which is described below.
98

109
## Using Gradle
1110

1211
The [ml-gradle plugin for Gradle](https://github.com/marklogic/ml-gradle) provides an `mlUnitTest` task for running
13-
all of your marklogic-unit-test tests. As noted in the [Getting started guide](/docs), you will need to
12+
all of your marklogic-unit-test tests. As noted in the [Getting started guide](getting-started.md), you will need to
1413
include the following block at the top of your `build.gradle` file to ensure this task can run successfully:
1514

1615
```
@@ -39,9 +38,9 @@ App Server.
3938
## Using the web application
4039

4140
Once you have deployed your application along with the marklogic-unit-test modules, as described in the
42-
[Getting started guide](/docs), you will be able to access a custom endpoint via any MarkLogic HTTP
41+
[Getting started guide](getting-started.md), you will be able to access a custom endpoint via any MarkLogic HTTP
4342
App Server associated with the modules database containing your application modules. The path of that endpoint is
44-
`/test/default.xqy`. For example, since the App Server in the [Getting started guide](/docs) listens on
43+
`/test/default.xqy`. For example, since the App Server in the [Getting started guide](getting-started.md) listens on
4544
port 8024, the endpoint would be accessible at <http://localhost:8024/test/default.xqy>.
4645

4746
The web application at this custom endpoint provides a functional, albeit antiquated-looking, interface for running

docs/writing-tests.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
layout: default
33
title: Writing tests
44
nav_order: 3
5-
permalink: /docs/writing
65
---
76

87
This guide is a reference on the different kinds of test modules, setup modules, and teardown modules you can write
@@ -12,7 +11,7 @@ in the `src/test/ml-modules/root/test/suites/thesaurus` directory in the
1211

1312
## Location of test files
1413

15-
As described in the [Getting started guide](/docs), marklogic-unit-test requires the URI of each module
14+
As described in the [Getting started guide](getting-started.md), marklogic-unit-test requires the URI of each module
1615
to begin with `/test/suites/(name of suite)/`. Thus, all test files should be located in an
1716
[ml-gradle modules directory](https://github.com/marklogic/ml-gradle/wiki/How-modules-are-loaded) under
1817
`root/test/suites/(name of suite)/`.
@@ -42,7 +41,7 @@ the test helper library to be followed by an import of the application module be
4241
const test = require("/test/test-helper.xqy");
4342
const lib = require("/example/lib.sjs");
4443

45-
The test should then return the output of one or more [assertion functions](/docs/assertions)
44+
The test should then return the output of one or more [assertion functions](assertion-functions.md)
4645
found in the `test-helper` module. This can be done via a single array:
4746

4847
```
@@ -97,7 +96,7 @@ import module namespace ex="http://example.org" at "/example/lib.xqy";
9796
```
9897

9998
The test will then call the function to be tested and use the helper library to invoke one or more
100-
[assertion functions](/docs/assertions), returning the results of those assertions:
99+
[assertion functions](assertion-functions.md), returning the results of those assertions:
101100

102101
```
103102
let $result := ex:lookup-term("Car", "elements")

0 commit comments

Comments
 (0)