You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With those additions in place, the "mlUnitTest" task can be run. This task will use the value of mlTestRestPort to
29
-
determine which MarkLogic app server to connect to.
30
+
## Running unit tests
31
+
32
+
With the above additions in place, the "mlUnitTest" task can be run. This task will use the value of mlTestRestPort to
33
+
determine which MarkLogic app server to connect to - see below for how to customize this.
30
34
31
35
First, deploy the application:
32
36
@@ -56,3 +60,28 @@ You can also access the ml-unit-test REST endpoints directly:
56
60
And you can run the original UI test runner by going to:
57
61
58
62
-http://localhost:8135/test/default.xqy
63
+
64
+
## Configuring which server mlUnitTest connects to
65
+
66
+
Prior to ml-gradle 3.8.1, the mlUnitTest task will connect to mlTestRestPort if it's set, else mlRestPort.
67
+
68
+
Starting in release 3.8.1, you can configure which REST API server mlUnitTest will connect to. The mlUnitTest task now
69
+
exposes a property of type [DatabaseClientConfig](https://github.com/marklogic-community/ml-javaclient-util/blob/master/src/main/java/com/marklogic/client/ext/DatabaseClientConfig.java).
70
+
You can configure the properties of this object, and mlUnitTest will use it for creating a connection to MarkLogic.
71
+
72
+
Below is an example - note that you need to configure every property necessary for the type of connection you want, as
73
+
none of the properties of the DatabaseClientConfig have any default value:
74
+
75
+
mlUnitTest.databaseClientConfig.host = mlHost
76
+
mlUnitTest.databaseClientConfig.port = 8880 // probably a port that differs from mlRestPort and mlTestRestPort
0 commit comments