Skip to content

Merging release/6.3.0 into master #1602

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
87652cc
Adding CODEOWNERS
rjrudin Jul 19, 2023
5441932
Merge pull request #1578 from marklogic/feature/codeowners
rjrudin Jul 19, 2023
2405dae
Fixing warning in cookbook reported by Snyk
rjrudin Jul 19, 2023
7b595d7
Merge pull request #1579 from marklogic/feature/cookbook-upgrade
rjrudin Jul 19, 2023
e341335
Forcing usage of okio 3.4.0
rjrudin Aug 7, 2023
9f628ff
Merge pull request #1581 from marklogic/feature/bump-okio
rjrudin Aug 10, 2023
6efb8cb
Updated test based on DBQ-126 fix
rjrudin Aug 15, 2023
c573f0c
Merge pull request #1583 from marklogic/feature/optic-test-fix
rjrudin Aug 15, 2023
2a6010e
Added comment about ML-Check-ML11-Headers
rjrudin Aug 15, 2023
e05f32f
Merge pull request #1584 from marklogic/feature/headers-comment
rjrudin Aug 15, 2023
287387d
Added test for two-way SSL.
rjrudin Aug 16, 2023
92951c3
Added example of removing the Accept-Encoding header
rjrudin Aug 17, 2023
a88770d
Merge pull request #1586 from marklogic/feature/okhttp-example
rjrudin Aug 18, 2023
b9aa2e3
Merge pull request #1585 from marklogic/feature/2way-ssl-test
rjrudin Aug 18, 2023
5df0ce8
Bumping htmlcleaner in example project to 2.29
rjrudin Aug 21, 2023
53c54c2
Renamed test roles to make it clear they're for the Java Client
rjrudin Aug 21, 2023
d78d459
Merge pull request #1587 from marklogic/feature/rename-test-role
rjrudin Aug 21, 2023
e335e18
DEVEXP-155 Added disabled test for setMaxBatches
rjrudin Aug 21, 2023
091ccad
Merge pull request #1588 from marklogic/feature/155-testing
rjrudin Aug 22, 2023
9ce673a
DEVEXP-469 Optimistic locking failures now throw concrete exceptions
rjrudin May 23, 2023
4339746
DEVEXP-491 Can now configure token duration
rjrudin Aug 22, 2023
6cf0b16
Merge pull request #1590 from marklogic/feature/469-optimistic
rjrudin Aug 22, 2023
e41aa86
Merge pull request #1589 from marklogic/feature/491-cloud-token
rjrudin Aug 25, 2023
93ae28f
DEVEXP-478 New addFromString method for permissions
rjrudin Aug 25, 2023
a712d7c
Merge pull request #1592 from marklogic/feature/478-permissions
rjrudin Aug 25, 2023
2e5fda6
DEVEXP-562 Can now prevent Accept-Encoding=gzip header being used
rjrudin Aug 25, 2023
daec921
Merge pull request #1593 from marklogic/feature/562-gzip
rjrudin Aug 28, 2023
69be3f7
Not running 2-way SSL test against reverse proxy
rjrudin Aug 29, 2023
5162e40
Bumping Jackson dependencies to latest
rjrudin Aug 29, 2023
1aee82a
Merge pull request #1594 from marklogic/feature/jackson-bump
rjrudin Aug 29, 2023
92f21c8
Bumping Gradle wrapper version
rjrudin Aug 30, 2023
c3e2f48
Merge pull request #1596 from marklogic/feature/test-fixes
rjrudin Aug 30, 2023
3e41061
ml-development-tools now uses test-app
rjrudin Aug 30, 2023
1397b06
Merge pull request #1597 from marklogic/feature/ml-dev-tools-test-app
rjrudin Aug 30, 2023
ae61428
Bumped dependencies on dev-tools
rjrudin Aug 30, 2023
86b1ef2
Merge pull request #1598 from marklogic/feature/bump-dev-tools
rjrudin Sep 5, 2023
e4eb309
Added example project for testing ml-development-tools
rjrudin Aug 30, 2023
653e08f
Adding badges to README
rjrudin May 9, 2023
d9ec4cf
Merge pull request #1599 from marklogic/feature/dev-tools-project
rjrudin Sep 5, 2023
e8236b0
Merge pull request #1600 from marklogic/feature/badges
rjrudin Sep 5, 2023
f6ffb14
Bumping Kotlin dependencies from 1.6 to 1.8
rjrudin Sep 7, 2023
548336a
Bumped to 6.3.0
rjrudin Sep 6, 2023
1bbd6e0
Merge branch 'master' into release/6.3.0
rjrudin Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,5 @@ bin
repairXMLFull.xml
xml-with-props.xml

ml-development-tools/src/test/ml-modules
ml-development-tools/src/test/java/com/marklogic/client/test/dbfunction/generated
5 changes: 5 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Lines starting with '#' are comments.
# Each line is a file pattern followed by one or more owners.

# These owners will be the default owners for everything in the repo.
* @anu3990 @billfarber @rjrudin
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ Individual tests can be run in the following manner (replace `GraphsTest` with t

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

Tests for the `ml-development-tools` Gradle plugin can be run via:

./gradlew ml-development-tools:test

You can also undeploy the test application if you do not wish to keep it around on your MarkLogic instance:

./gradlew mlUndeploy -i -Pconfirm=true

To test the `ml-development-tools` Gradle plugin, see the README.md file located at
`ml-development-tools/src/test/example-project`.
2 changes: 0 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ def runAllTests(String type, String version, Boolean useReverseProxy){
export PATH=$GRADLE_USER_HOME:$JAVA_HOME/bin:$PATH
cd java-client-api
mkdir -p ml-development-tools/build/test-results/test
./gradlew ml-development-tools:setupTestServer || true
./gradlew ml-development-tools:generateTests || true
./gradlew ml-development-tools:test || true
'''

Expand Down
8 changes: 4 additions & 4 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6370,7 +6370,7 @@ License Text (http://spdx.org/licenses/Apache-2.0)
Made available under the Apache License 2.0. See Appendix for full text.

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

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

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

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

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

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

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

Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
![GitHub release](https://img.shields.io/github/release/marklogic/java-client-api.svg)
![GitHub last commit](https://img.shields.io/github/last-commit/marklogic/java-client-api.svg)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Known Vulnerabilities](https://snyk.io/test/github/marklogic/java-client-api/badge.svg)](https://snyk.io/test/github/marklogic/java-client-api)

# The MarkLogic Java Client API

The API makes it easy to write, read, delete, and find documents
Expand Down
9 changes: 6 additions & 3 deletions examples/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ dependencies {
}
implementation project(':marklogic-client-api')

// Forcing usage of 3.4.0 instead of 3.2.0 to address vulnerability - https://security.snyk.io/vuln/SNYK-JAVA-COMSQUAREUPOKIO-5820002
implementation 'com.squareup.okio:okio:3.4.0'

// The 'api' configuration is used so that the test configuration in marklogic-client-api doesn't have to declare
// all of these dependencies. This library project won't otherwise be depended on by anything else as it's not
// setup for publishing.
api 'com.squareup.okhttp3:okhttp:4.10.0'
api 'com.squareup.okhttp3:okhttp:4.11.0'
api 'io.github.rburgst:okhttp-digest:2.7'
api 'org.slf4j:slf4j-api:1.7.36'
api 'com.fasterxml.jackson.core:jackson-databind:2.14.1'
api 'com.fasterxml.jackson.core:jackson-databind:2.15.2'

// hsqldb < 2.7 has a High CVE - https://nvd.nist.gov/vuln/detail/CVE-2022-41853 .
// And hsqldb 2.6+ requires Java 11+. So this is ignored, along with the associated test,
Expand All @@ -30,7 +33,7 @@ dependencies {
api 'com.google.code.gson:gson:2.10.1'
api 'net.sourceforge.htmlcleaner:htmlcleaner:2.29'
api 'com.opencsv:opencsv:4.6'
api 'org.springframework:spring-jdbc:5.3.27'
api 'org.springframework:spring-jdbc:5.3.29'
api 'org.apache.commons:commons-lang3:3.12.0'
api 'org.apache.httpcomponents:httpclient:4.5.14'
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.marklogic.client.example.cookbook;

import com.marklogic.client.DatabaseClientFactory;
import com.marklogic.client.extra.okhttpclient.OkHttpClientConfigurator;
import okhttp3.OkHttpClient;
import okhttp3.Request;

/**
* Provides examples of configuring the underlying OkHttp client for various use cases.
*/
public class ConfigureOkHttp {

/**
* OkHttp 4.x includes a header of "Accept-Encoding=gzip" by default. The following shows how to use an OkHttp
* interceptor to remove this header from every request. By doing this via a configurator passed to
* {@code DatabaseClientFactory}, every {@code DatabaseClient} created via the factory will inherit this
* interceptor.
*
* Note that while the Accept-Encoding header can contain multiple values - see
* https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding for examples - the MarkLogic Java
* Client does not set this header and OkHttp only sets it to "gzip" for every request. Thus, removing the
* header should not result in losing any other values besides "gzip" for the header. You are free to
* customize this as you wish though; this is primarily intended as an example for how to customize OkHttp
* when using the MarkLogic Java Client.
*
* As of Java Client 6.3.0, this can now be accomplished via the {@code DatabaseClientFactory} class and
* {@code RemoveAcceptEncodingConfigurator}.
*/
public static void removeAcceptEncodingGzipHeader() {
DatabaseClientFactory.addConfigurator(new OkHttpClientConfigurator() {
@Override
public void configure(OkHttpClient.Builder builder) {
builder.addNetworkInterceptor(chain -> {
Request newRequest = chain.request().newBuilder().removeHeader("Accept-Encoding").build();
return chain.proceed(newRequest);
});
}
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public X509Certificate[] getAcceptedIssuers() {
};

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

// create the client
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
group=com.marklogic
version=6.2.2
version=6.3.0
describedName=MarkLogic Java Client API
publishUrl=file:../marklogic-java/releases

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
13 changes: 7 additions & 6 deletions marklogic-client-api-functionaltests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,18 @@ task testSandbox(type:Test) {

dependencies {
implementation project (':marklogic-client-api')
implementation 'org.skyscreamer:jsonassert:1.5.0'
implementation 'org.skyscreamer:jsonassert:1.5.1'
implementation 'org.slf4j:slf4j-api:1.7.36'
implementation 'commons-io:commons-io:2.11.0'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation 'com.fasterxml.jackson.core:jackson-core:2.14.1'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.1'
implementation 'com.squareup.okio:okio:3.4.0'
implementation 'com.squareup.okhttp3:okhttp:4.11.0'
implementation 'com.fasterxml.jackson.core:jackson-core:2.15.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.15.2'
implementation "org.jdom:jdom2:2.0.6.1"
implementation "com.marklogic:ml-app-deployer:4.4.0"
implementation "com.marklogic:ml-app-deployer:4.5.2"

testImplementation 'ch.qos.logback:logback-classic:1.3.5'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
testImplementation 'org.xmlunit:xmlunit-legacy:2.9.0'
testImplementation 'org.apache.commons:commons-lang3:3.12.0'
testImplementation 'org.apache.httpcomponents:httpclient:4.5.14'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.marklogic.client.fastfunctest;

import com.marklogic.client.ContentNoVersionException;
import com.marklogic.client.FailedRequestException;
import com.marklogic.client.admin.ServerConfigurationManager;
import com.marklogic.client.admin.ServerConfigurationManager.UpdatePolicy;
Expand All @@ -29,6 +30,8 @@

import java.io.File;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;

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

String exception = "";
String statusCode = "";
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";
int expCode = 0;
// update document with no content version
try {
docMgr.write(docUri, handle);
} catch (FailedRequestException e) {
exception = e.toString();
statusCode = e.getFailedRequest().getMessageCode();
expCode = e.getFailedRequest().getStatusCode();
}
System.out.println("Exception is " + exception);
System.out.println("Status message --- codenumber are " + statusCode + " --- " + expCode);
assertTrue( statusCode.contains("RESTAPI-CONTENTNOVERSION"));
assertTrue( expCode == 428);
assertTrue( exception.contains(expectedException));
ContentNoVersionException ex = assertThrows(ContentNoVersionException.class, () -> docMgr.write(docUri, handle));
assertEquals(428, ex.getServerStatusCode());
}

@AfterAll
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2991,8 +2991,9 @@ public void testColInfoWithSysCols() {
new ColumnInfo("DetailName", "string"),
new ColumnInfo("opticFunctionalTest", "detail", "amount", "double"),
new ColumnInfo("opticFunctionalTest", "detail", "color", "string"),
new ColumnInfo("opticFunctionalTest", "detail", "fragIdCol1", expectedFragmentValue, true),
new ColumnInfo("opticFunctionalTest", "master", "fragIdCol2", expectedFragmentValue, true)
// Per DBQ-123, since the fragment IDs are being selected, hidden should now be false
new ColumnInfo("opticFunctionalTest", "detail", "fragIdCol1", expectedFragmentValue, false),
new ColumnInfo("opticFunctionalTest", "master", "fragIdCol2", expectedFragmentValue, false)
);
}
}
Loading