Skip to content

Commit

Permalink
Merge pull request #1602 from marklogic/release/6.3.0
Browse files Browse the repository at this point in the history
Merging release/6.3.0 into master
  • Loading branch information
rjrudin authored Sep 7, 2023
2 parents d6e22f0 + 1bbd6e0 commit 7c73f9d
Show file tree
Hide file tree
Showing 67 changed files with 1,351 additions and 1,211 deletions.
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

0 comments on commit 7c73f9d

Please sign in to comment.