Skip to content

Commit 7c73f9d

Browse files
authored
Merge pull request #1602 from marklogic/release/6.3.0
Merging release/6.3.0 into master
2 parents d6e22f0 + 1bbd6e0 commit 7c73f9d

File tree

67 files changed

+1351
-1211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1351
-1211
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ bin
3333
repairXMLFull.xml
3434
xml-with-props.xml
3535

36+
ml-development-tools/src/test/ml-modules
37+
ml-development-tools/src/test/java/com/marklogic/client/test/dbfunction/generated

CODEOWNERS

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Lines starting with '#' are comments.
2+
# Each line is a file pattern followed by one or more owners.
3+
4+
# These owners will be the default owners for everything in the repo.
5+
* @anu3990 @billfarber @rjrudin

CONTRIBUTING.md

+7
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ Individual tests can be run in the following manner (replace `GraphsTest` with t
4141

4242
./gradlew marklogic-client-api:test --tests GraphsTest
4343

44+
Tests for the `ml-development-tools` Gradle plugin can be run via:
45+
46+
./gradlew ml-development-tools:test
47+
4448
You can also undeploy the test application if you do not wish to keep it around on your MarkLogic instance:
4549

4650
./gradlew mlUndeploy -i -Pconfirm=true
51+
52+
To test the `ml-development-tools` Gradle plugin, see the README.md file located at
53+
`ml-development-tools/src/test/example-project`.

Jenkinsfile

-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,6 @@ def runAllTests(String type, String version, Boolean useReverseProxy){
5050
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
5151
cd java-client-api
5252
mkdir -p ml-development-tools/build/test-results/test
53-
./gradlew ml-development-tools:setupTestServer || true
54-
./gradlew ml-development-tools:generateTests || true
5553
./gradlew ml-development-tools:test || true
5654
'''
5755

NOTICE.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -6370,7 +6370,7 @@ License Text (http://spdx.org/licenses/Apache-2.0)
63706370
Made available under the Apache License 2.0. See Appendix for full text.
63716371

63726372
Source materials are available for download at: https://github.com/FasterXML/jackson-annotations
6373-
Jackson Annotations 2.14.1
6373+
Jackson Annotations 2.15.2
63746374
Attribution Statements
63756375
http://wiki.fasterxml.com/JacksonHome
63766376

@@ -6403,7 +6403,7 @@ License Text (http://www.apache.org/licenses/LICENSE-2.0.txt)
64036403
Made available under the Apache License 2.0. See Appendix for full text.
64046404

64056405
Source materials are available for download at: https://github.com/FasterXML/jackson-core
6406-
Jackson Core 2.14.1
6406+
Jackson Core 2.15.2
64076407
Attribution Statements
64086408
http://wiki.fasterxml.com/JacksonHome
64096409

@@ -6450,7 +6450,7 @@ License Text (http://www.apache.org/licenses/LICENSE-2.0.txt)
64506450
Made available under the Apache License 2.0. See Appendix for full text.
64516451

64526452
Source materials are available for download at: https://github.com/FasterXML/jackson-databind
6453-
Jackson Databind 2.14.1
6453+
Jackson Databind 2.15.2
64546454
Attribution Statements
64556455
http://wiki.fasterxml.com/JacksonHome
64566456

@@ -6468,7 +6468,7 @@ License Text (http://www.apache.org/licenses/LICENSE-2.0.txt)
64686468
Made available under the Apache License 2.0. See Appendix for full text.
64696469

64706470
Source materials are available for download at: https://github.com/FasterXML/jackson-databind
6471-
Jackson Dataformat CSV 2.10.3
6471+
Jackson Dataformat CSV 2.15.2
64726472
Attribution Statements
64736473
https://github.com/FasterXML/jackson-dataformat-csv
64746474

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
![GitHub release](https://img.shields.io/github/release/marklogic/java-client-api.svg)
2+
![GitHub last commit](https://img.shields.io/github/last-commit/marklogic/java-client-api.svg)
3+
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4+
[![Known Vulnerabilities](https://snyk.io/test/github/marklogic/java-client-api/badge.svg)](https://snyk.io/test/github/marklogic/java-client-api)
5+
16
# The MarkLogic Java Client API
27

38
The API makes it easy to write, read, delete, and find documents

examples/build.gradle

+6-3
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ dependencies {
1212
}
1313
implementation project(':marklogic-client-api')
1414

15+
// Forcing usage of 3.4.0 instead of 3.2.0 to address vulnerability - https://security.snyk.io/vuln/SNYK-JAVA-COMSQUAREUPOKIO-5820002
16+
implementation 'com.squareup.okio:okio:3.4.0'
17+
1518
// The 'api' configuration is used so that the test configuration in marklogic-client-api doesn't have to declare
1619
// all of these dependencies. This library project won't otherwise be depended on by anything else as it's not
1720
// setup for publishing.
18-
api 'com.squareup.okhttp3:okhttp:4.10.0'
21+
api 'com.squareup.okhttp3:okhttp:4.11.0'
1922
api 'io.github.rburgst:okhttp-digest:2.7'
2023
api 'org.slf4j:slf4j-api:1.7.36'
21-
api 'com.fasterxml.jackson.core:jackson-databind:2.14.1'
24+
api 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
2225

2326
// hsqldb < 2.7 has a High CVE - https://nvd.nist.gov/vuln/detail/CVE-2022-41853 .
2427
// And hsqldb 2.6+ requires Java 11+. So this is ignored, along with the associated test,
@@ -30,7 +33,7 @@ dependencies {
3033
api 'com.google.code.gson:gson:2.10.1'
3134
api 'net.sourceforge.htmlcleaner:htmlcleaner:2.29'
3235
api 'com.opencsv:opencsv:4.6'
33-
api 'org.springframework:spring-jdbc:5.3.27'
36+
api 'org.springframework:spring-jdbc:5.3.29'
3437
api 'org.apache.commons:commons-lang3:3.12.0'
3538
api 'org.apache.httpcomponents:httpclient:4.5.14'
3639
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package com.marklogic.client.example.cookbook;
2+
3+
import com.marklogic.client.DatabaseClientFactory;
4+
import com.marklogic.client.extra.okhttpclient.OkHttpClientConfigurator;
5+
import okhttp3.OkHttpClient;
6+
import okhttp3.Request;
7+
8+
/**
9+
* Provides examples of configuring the underlying OkHttp client for various use cases.
10+
*/
11+
public class ConfigureOkHttp {
12+
13+
/**
14+
* OkHttp 4.x includes a header of "Accept-Encoding=gzip" by default. The following shows how to use an OkHttp
15+
* interceptor to remove this header from every request. By doing this via a configurator passed to
16+
* {@code DatabaseClientFactory}, every {@code DatabaseClient} created via the factory will inherit this
17+
* interceptor.
18+
*
19+
* Note that while the Accept-Encoding header can contain multiple values - see
20+
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding for examples - the MarkLogic Java
21+
* Client does not set this header and OkHttp only sets it to "gzip" for every request. Thus, removing the
22+
* header should not result in losing any other values besides "gzip" for the header. You are free to
23+
* customize this as you wish though; this is primarily intended as an example for how to customize OkHttp
24+
* when using the MarkLogic Java Client.
25+
*
26+
* As of Java Client 6.3.0, this can now be accomplished via the {@code DatabaseClientFactory} class and
27+
* {@code RemoveAcceptEncodingConfigurator}.
28+
*/
29+
public static void removeAcceptEncodingGzipHeader() {
30+
DatabaseClientFactory.addConfigurator(new OkHttpClientConfigurator() {
31+
@Override
32+
public void configure(OkHttpClient.Builder builder) {
33+
builder.addNetworkInterceptor(chain -> {
34+
Request newRequest = chain.request().newBuilder().removeHeader("Accept-Encoding").build();
35+
return chain.proceed(newRequest);
36+
});
37+
}
38+
});
39+
}
40+
}

examples/src/main/java/com/marklogic/client/example/cookbook/KerberosSSLClientCreator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public X509Certificate[] getAcceptedIssuers() {
6161
};
6262

6363
// create an SSL context
64-
SSLContext sslContext = SSLContext.getInstance("SSLv3");
64+
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
6565
sslContext.init(null, new TrustManager[] { naiveTrustMgr }, null);
6666

6767
// create the client

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.marklogic
2-
version=6.2.2
2+
version=6.3.0
33
describedName=MarkLogic Java Client API
44
publishUrl=file:../marklogic-java/releases
55

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

marklogic-client-api-functionaltests/build.gradle

+7-6
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,18 @@ task testSandbox(type:Test) {
2020

2121
dependencies {
2222
implementation project (':marklogic-client-api')
23-
implementation 'org.skyscreamer:jsonassert:1.5.0'
23+
implementation 'org.skyscreamer:jsonassert:1.5.1'
2424
implementation 'org.slf4j:slf4j-api:1.7.36'
2525
implementation 'commons-io:commons-io:2.11.0'
26-
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
27-
implementation 'com.fasterxml.jackson.core:jackson-core:2.14.1'
28-
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.1'
26+
implementation 'com.squareup.okio:okio:3.4.0'
27+
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
28+
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.2'
29+
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
2930
implementation "org.jdom:jdom2:2.0.6.1"
30-
implementation "com.marklogic:ml-app-deployer:4.4.0"
31+
implementation "com.marklogic:ml-app-deployer:4.5.2"
3132

3233
testImplementation 'ch.qos.logback:logback-classic:1.3.5'
33-
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
34+
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
3435
testImplementation 'org.xmlunit:xmlunit-legacy:2.9.0'
3536
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
3637
testImplementation 'org.apache.httpcomponents:httpclient:4.5.14'

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestBug18920.java

+5-16
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.marklogic.client.fastfunctest;
1818

19+
import com.marklogic.client.ContentNoVersionException;
1920
import com.marklogic.client.FailedRequestException;
2021
import com.marklogic.client.admin.ServerConfigurationManager;
2122
import com.marklogic.client.admin.ServerConfigurationManager.UpdatePolicy;
@@ -29,6 +30,8 @@
2930

3031
import java.io.File;
3132

33+
import static org.junit.jupiter.api.Assertions.assertEquals;
34+
import static org.junit.jupiter.api.Assertions.assertThrows;
3235
import static org.junit.jupiter.api.Assertions.assertTrue;
3336

3437
public class TestBug18920 extends AbstractFunctionalTest {
@@ -81,23 +84,9 @@ public void testBug18920() {
8184
String docUri = desc.getUri();
8285
System.out.println(docUri);
8386

84-
String exception = "";
85-
String statusCode = "";
86-
String expectedException = "com.marklogic.client.FailedRequestException: Local message: Content version required to write document. Server Message: RESTAPI-CONTENTNOVERSION: (err:FOER0000) No content version supplied: uri /bug18920/xml-original.xml";
87-
int expCode = 0;
8887
// update document with no content version
89-
try {
90-
docMgr.write(docUri, handle);
91-
} catch (FailedRequestException e) {
92-
exception = e.toString();
93-
statusCode = e.getFailedRequest().getMessageCode();
94-
expCode = e.getFailedRequest().getStatusCode();
95-
}
96-
System.out.println("Exception is " + exception);
97-
System.out.println("Status message --- codenumber are " + statusCode + " --- " + expCode);
98-
assertTrue( statusCode.contains("RESTAPI-CONTENTNOVERSION"));
99-
assertTrue( expCode == 428);
100-
assertTrue( exception.contains(expectedException));
88+
ContentNoVersionException ex = assertThrows(ContentNoVersionException.class, () -> docMgr.write(docUri, handle));
89+
assertEquals(428, ex.getServerStatusCode());
10190
}
10291

10392
@AfterAll

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/fastfunctest/TestOpticOnViews.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -2991,8 +2991,9 @@ public void testColInfoWithSysCols() {
29912991
new ColumnInfo("DetailName", "string"),
29922992
new ColumnInfo("opticFunctionalTest", "detail", "amount", "double"),
29932993
new ColumnInfo("opticFunctionalTest", "detail", "color", "string"),
2994-
new ColumnInfo("opticFunctionalTest", "detail", "fragIdCol1", expectedFragmentValue, true),
2995-
new ColumnInfo("opticFunctionalTest", "master", "fragIdCol2", expectedFragmentValue, true)
2994+
// Per DBQ-123, since the fragment IDs are being selected, hidden should now be false
2995+
new ColumnInfo("opticFunctionalTest", "detail", "fragIdCol1", expectedFragmentValue, false),
2996+
new ColumnInfo("opticFunctionalTest", "master", "fragIdCol2", expectedFragmentValue, false)
29962997
);
29972998
}
29982999
}

0 commit comments

Comments
 (0)