Skip to content

Commit b5350b2

Browse files
committed
Merge branch 'release-4.1.2' into 4.0-master
2 parents 9803cca + e9f6bd8 commit b5350b2

File tree

464 files changed

+23101
-7997
lines changed

Some content is hidden

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

464 files changed

+23101
-7997
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# CHANGELOG
22

3+
## 4.1.2
4+
#### New Functionality
5+
- [#995](https://github.com/marklogic/java-client-api/issues/995) - Support for Kerberos keytab file to authenticate
6+
7+
#### Improvements and Bug Fixes
8+
- [#1020](https://github.com/marklogic/java-client-api/issues/1020) - Provide missing DatabaseClientFactory Bean configuration
9+
- [#1046](https://github.com/marklogic/java-client-api/issues/1046) - Jackson library upgrade to version 2.9.8
10+
311
## 4.1.1
412
#### New Functionality
513
- [#1006](https://github.com/marklogic/java-client-api/issues/1006) - Data Services First - MarkLogic's support for microservices

LEGALNOTICES.TXT

Lines changed: 2392 additions & 2342 deletions
Large diffs are not rendered by default.

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group=com.marklogic
2-
version=4.1.1
3-
releaseVersion=4.1.1
2+
version=4.1.2
3+
releaseVersion=4.1.2
44
describedName=MarkLogic Java Client API
55
publishUrl=file:../marklogic-java/releases

marklogic-client-api-functionaltests/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ test {
22
testLogging{
33
events 'started','passed', 'skipped'
44
}
5-
5+
/* For use in testing TestDatabaseClientKerberosFromFile */
6+
systemProperty "keytabFile", System.getProperty("keytabFile")
7+
systemProperty "principal", System.getProperty("principal")
8+
69
exclude 'com/marklogic/client/functionaltest/TestSSLConnection.class'
710
exclude 'com/marklogic/client/functionaltest/TestBug18993.class'
811
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientWithKerberos.class'
12+
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientKerberosFromFile.class'
913
exclude 'com/marklogic/client/functionaltest/TestDatabaseClientWithCertBasedAuth.class'
1014
exclude 'com/marklogic/client/functionaltest/TestSandBox.class'
1115
}

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/ApplyTransformTest.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@
2222

2323
import java.io.File;
2424
import java.time.Duration;
25-
import java.util.*;
25+
import java.util.ArrayList;
26+
import java.util.Arrays;
27+
import java.util.Collections;
28+
import java.util.HashMap;
29+
import java.util.HashSet;
30+
import java.util.List;
31+
import java.util.Map;
32+
import java.util.Random;
33+
import java.util.Set;
2634
import java.util.concurrent.TimeUnit;
2735
import java.util.concurrent.atomic.AtomicBoolean;
2836
import java.util.concurrent.atomic.AtomicInteger;
@@ -37,7 +45,6 @@
3745
import com.fasterxml.jackson.databind.JsonNode;
3846
import com.fasterxml.jackson.databind.ObjectMapper;
3947
import com.marklogic.client.DatabaseClient;
40-
import com.marklogic.client.DatabaseClientFactory.Authentication;
4148
import com.marklogic.client.admin.ExtensionMetadata;
4249
import com.marklogic.client.admin.TransformExtensionsManager;
4350
import com.marklogic.client.datamovement.ApplyTransformListener;
@@ -68,7 +75,6 @@ public class ApplyTransformTest extends BasicJavaClientREST {
6875
private static final String TEST_DIR_PREFIX = "/WriteHostBatcher-testdata/";
6976

7077
private static DatabaseClient dbClient;
71-
private static String host = null;
7278
private static String user = "admin";
7379
private static int port = 8000;
7480
private static String password = "admin";
@@ -103,7 +109,6 @@ public static void setUpBeforeClass() throws Exception {
103109
server = getRestAppServerName();
104110
port = getRestAppServerPort();
105111

106-
host = getRestAppServerHostName();
107112
hostNames = getHosts();
108113
createDB(dbName);
109114
Thread.currentThread().sleep(500L);
@@ -251,7 +256,7 @@ public void xQueryMasstransformReplace() throws Exception {
251256
ApplyTransformListener listener = new ApplyTransformListener().withTransform(transform)
252257
.withApplyResult(ApplyResult.REPLACE).onSuccess(batch -> {
253258
success.addAndGet(batch.getItems().length);
254-
}).onBatchFailure((batch, throwable) -> {
259+
}).onFailure((batch, throwable) -> {
255260
throwable.printStackTrace();
256261
}).onSkipped(batch -> {
257262
skipped.addAndGet(batch.getItems().length);
@@ -303,7 +308,7 @@ public void nonExistentDocsTransform() throws Exception {
303308
ApplyTransformListener listener = new ApplyTransformListener().withTransform(transform)
304309
.withApplyResult(ApplyResult.REPLACE).onSuccess(batch -> {
305310
success.addAndGet(batch.getItems().length);
306-
}).onBatchFailure((batch, throwable) -> {
311+
}).onFailure((batch, throwable) -> {
307312
failure.addAndGet(batch.getItems().length);
308313
throwable.printStackTrace();
309314
}).onSkipped(batch -> {
@@ -511,12 +516,13 @@ public void failedTransformTest() throws Exception {
511516
.withApplyResult(ApplyResult.REPLACE).onSuccess(batch -> {
512517
List<String> batchList = Arrays.asList(batch.getItems());
513518
successBatch.addAll(batchList);
514-
}).onBatchFailure((batch, throwable) -> {
519+
}).onFailure((batch, throwable) -> {
515520
failCount.addAndGet(1);
516521
List<String> batchList = Arrays.asList(batch.getItems());
517522
failedBatch.addAll(batchList);
518523
throwable.printStackTrace();
519524
System.out.println("Failure batch " + batch.getItems().length);
525+
// String set to null on purpose, to get an Exception.
520526
String s = null;
521527
s.charAt(0);
522528
}).onSkipped(batch -> {
@@ -610,7 +616,7 @@ public void jsMasstransformReplaceDelete() throws Exception {
610616
String s = null;
611617
s.charAt(0);
612618

613-
}).onBatchFailure((batch, throwable) -> {
619+
}).onFailure((batch, throwable) -> {
614620
isFailureCalled.set(true);
615621
throwable.printStackTrace();
616622

@@ -720,7 +726,7 @@ public void stopTransformJobTest() throws Exception {
720726
skippedBatch.addAll(Arrays.asList(batch.getItems()));
721727
System.out.println("stopTransformJobTest : Skipped: " + batch.getItems()[0]);
722728

723-
}).onBatchFailure((batch, throwable) -> {
729+
}).onFailure((batch, throwable) -> {
724730
throwable.printStackTrace();
725731
System.out.println("stopTransformJobTest: Failed: " + batch.getItems()[0]);
726732

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/DeleteListenerTest.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,15 @@
3333
import com.fasterxml.jackson.databind.JsonNode;
3434
import com.fasterxml.jackson.databind.ObjectMapper;
3535
import com.marklogic.client.DatabaseClient;
36-
import com.marklogic.client.DatabaseClientFactory;
37-
import com.marklogic.client.DatabaseClientFactory.Authentication;
3836
import com.marklogic.client.datamovement.DataMovementManager;
3937
import com.marklogic.client.datamovement.DeleteListener;
4038
import com.marklogic.client.datamovement.JobTicket;
4139
import com.marklogic.client.datamovement.QueryBatcher;
4240
import com.marklogic.client.datamovement.UrisToWriterListener;
4341
import com.marklogic.client.datamovement.WriteBatcher;
44-
import com.marklogic.client.functionaltest.BasicJavaClientREST;
4542
import com.marklogic.client.document.DocumentPage;
4643
import com.marklogic.client.document.DocumentRecord;
47-
import com.marklogic.client.impl.DatabaseClientImpl;
44+
import com.marklogic.client.functionaltest.BasicJavaClientREST;
4845
import com.marklogic.client.io.DocumentMetadataHandle;
4946
import com.marklogic.client.io.FileHandle;
5047
import com.marklogic.client.io.Format;
@@ -87,7 +84,7 @@ public static void setUpBeforeClass() throws Exception {
8784
hostNames = getHosts();
8885
createDB(dbName);
8986
Thread.currentThread().sleep(500L);
90-
//Ensure db has atleast one forest
87+
//Ensure DB has at-least one forest
9188
createForestonHost(dbName + "-" + forestCount, dbName, hostNames[0]);
9289
forestCount++;
9390
for (String forestHost : hostNames) {
@@ -106,7 +103,6 @@ public static void setUpBeforeClass() throws Exception {
106103
}
107104

108105
dbClient = getDatabaseClient(user, password, getConnType());
109-
DatabaseClient adminClient = DatabaseClientFactory.newClient(host, 8000, user, password, Authentication.DIGEST);
110106
dmManager = dbClient.newDataMovementManager();
111107

112108
// JacksonHandle
@@ -402,7 +398,7 @@ public void run() {
402398
if (failures2.length() > 0)
403399
fail(failures2.toString());
404400

405-
assertEquals("There should be 0 documents in t++he db",
401+
assertEquals("There should be 0 documents in the db",
406402
0, dbClient.newServerEval().xquery(query1).eval().next().getNumber().intValue());
407403

408404
DocumentPage page = dbClient.newDocumentManager().read("/local/json-1998");

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/ExportListenerTest.java

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,13 @@
3232

3333
import com.fasterxml.jackson.databind.JsonNode;
3434
import com.marklogic.client.DatabaseClient;
35-
import com.marklogic.client.DatabaseClientFactory;
36-
import com.marklogic.client.DatabaseClientFactory.Authentication;
3735
import com.marklogic.client.datamovement.DataMovementManager;
3836
import com.marklogic.client.datamovement.DeleteListener;
3937
import com.marklogic.client.datamovement.ExportListener;
4038
import com.marklogic.client.datamovement.QueryBatcher;
4139
import com.marklogic.client.datamovement.WriteBatcher;
42-
import com.marklogic.client.functionaltest.BasicJavaClientREST;
4340
import com.marklogic.client.document.DocumentManager;
44-
import com.marklogic.client.impl.DatabaseClientImpl;
41+
import com.marklogic.client.functionaltest.BasicJavaClientREST;
4542
import com.marklogic.client.io.JacksonHandle;
4643
import com.marklogic.client.io.StringHandle;
4744
import com.marklogic.client.query.QueryManager;
@@ -52,12 +49,10 @@ public class ExportListenerTest extends BasicJavaClientREST {
5249
private static String dbName = "ExportListener";
5350
private static DataMovementManager dmManager = null;
5451
private static DatabaseClient dbClient;
55-
private static String host = null;
5652
private static String user = "admin";
5753
private static int port = 8000;
5854
private static String password = "admin";
5955
private static String server = "App-Services";
60-
private static JsonNode clusterInfo;
6156

6257
private static final String query1 = "fn:count(fn:doc())";
6358
private static String[] hostNames;
@@ -68,7 +63,6 @@ public static void setUpBeforeClass() throws Exception {
6863
server = getRestAppServerName();
6964
port = getRestAppServerPort();
7065

71-
host = getRestAppServerHostName();
7266
hostNames = getHosts();
7367
createDB(dbName);
7468
Thread.currentThread().sleep(500L);
@@ -85,12 +79,8 @@ public static void setUpBeforeClass() throws Exception {
8579
enableSecurityOnRESTServer(server, dbName);
8680
}
8781

88-
dbClient = getDatabaseClient(user, password, Authentication.DIGEST);
89-
DatabaseClient adminClient = DatabaseClientFactory.newClient(host, 8000, user, password, Authentication.DIGEST);
82+
dbClient = getDatabaseClient(user, password, getConnType());
9083
dmManager = dbClient.newDataMovementManager();
91-
92-
clusterInfo = ((DatabaseClientImpl) adminClient).getServices()
93-
.getResource(null, "internal/forestinfo", null, null, new JacksonHandle()).get();
9484
}
9585

9686
@AfterClass
@@ -343,12 +333,10 @@ public void testServerTimestampNoSnapshots() throws Exception {
343333
Thread.currentThread().sleep(5000L);
344334

345335
List<String> docExporterList = new ArrayList<String>();
346-
List<String> batcherList = new ArrayList<String>();
347336

348337
QueryManager queryMgr = dbClient.newQueryManager();
349338
StringQueryDefinition querydef = queryMgr.newStringDefinition();
350339
querydef.setCriteria("John AND Bob");
351-
StringBuffer batchResults = new StringBuffer();
352340

353341
try {
354342
// Listener is setup with no withConsistentSnapshot()
@@ -612,7 +600,7 @@ public void testOnBatchFailure() throws Exception {
612600
docExporterList.add(uriOfDoc);
613601
}
614602
)
615-
.onBatchFailure((batch, throwable) -> {
603+
.onFailure((batch, throwable) -> {
616604
onBatchFailureStr.append("From onBatchFailure QA Exception");
617605
System.out.println("From onBatchFailure " + throwable.getMessage());
618606
System.out.println("From onBatchFailure QA Exception");

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/ExportToWriterListenerTest.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,15 @@
4141
import com.fasterxml.jackson.databind.JsonNode;
4242
import com.fasterxml.jackson.databind.ObjectMapper;
4343
import com.marklogic.client.DatabaseClient;
44-
import com.marklogic.client.DatabaseClientFactory;
45-
import com.marklogic.client.DatabaseClientFactory.Authentication;
4644
import com.marklogic.client.datamovement.DataMovementManager;
4745
import com.marklogic.client.datamovement.DeleteListener;
4846
import com.marklogic.client.datamovement.ExportToWriterListener;
4947
import com.marklogic.client.datamovement.QueryBatcher;
5048
import com.marklogic.client.datamovement.WriteBatcher;
5149
import com.marklogic.client.document.DocumentManager;
5250
import com.marklogic.client.functionaltest.Artifact;
51+
import com.marklogic.client.functionaltest.BasicJavaClientREST;
5352
import com.marklogic.client.functionaltest.Company;
54-
import com.marklogic.client.impl.DatabaseClientImpl;
5553
import com.marklogic.client.io.DocumentMetadataHandle;
5654
import com.marklogic.client.io.DocumentMetadataHandle.DocumentMetadataValues;
5755
import com.marklogic.client.io.FileHandle;
@@ -64,7 +62,6 @@
6462
import com.marklogic.client.query.StringQueryDefinition;
6563
import com.marklogic.client.query.StructuredQueryBuilder;
6664
import com.marklogic.client.query.StructuredQueryDefinition;
67-
import com.marklogic.client.functionaltest.BasicJavaClientREST;
6865

6966
public class ExportToWriterListenerTest extends BasicJavaClientREST {
7067

@@ -73,12 +70,10 @@ public class ExportToWriterListenerTest extends BasicJavaClientREST {
7370
private static final String TEST_DIR_PREFIX = "/WriteHostBatcher-testdata/";
7471

7572
private static DatabaseClient dbClient;
76-
private static String host = null;
7773
private static String user = "admin";
7874
private static int port = 8000;
7975
private static String password = "admin";
8076
private static String server = "App-Services";
81-
private static JsonNode clusterInfo;
8277

8378
private static JacksonHandle jacksonHandle;
8479
private static StringHandle stringHandle;
@@ -103,7 +98,6 @@ public static void setUpBeforeClass() throws Exception {
10398
port = getRestAppServerPort();
10499

105100
dataConfigDirPath = getDataConfigDirPath();
106-
host = getRestAppServerHostName();
107101
hostNames = getHosts();
108102
createDB(dbName);
109103
Thread.currentThread().sleep(500L);
@@ -120,12 +114,9 @@ public static void setUpBeforeClass() throws Exception {
120114
enableSecurityOnRESTServer(server, dbName);
121115
}
122116

123-
dbClient = getDatabaseClient(user, password, Authentication.DIGEST);
124-
DatabaseClient adminClient = DatabaseClientFactory.newClient(host, 8000, user, password, Authentication.DIGEST);
117+
dbClient = getDatabaseClient(user, password, getConnType());
125118
dmManager = dbClient.newDataMovementManager();
126119

127-
clusterInfo = ((DatabaseClientImpl) adminClient).getServices()
128-
.getResource(null, "internal/forestinfo", null, null, new JacksonHandle()).get();
129120
// JacksonHandle
130121
jsonNode = new ObjectMapper().readTree("{\"k1\":\"v1\"}");
131122
jacksonHandle = new JacksonHandle();
@@ -592,7 +583,7 @@ record -> {
592583
return uri + "," + collection + "," + quality + "," + contents;
593584
}
594585
)
595-
.onBatchFailure((batch, throwable) -> {
586+
.onFailure((batch, throwable) -> {
596587
onBatchFailureStr.append("From onBatchFailure QA Exception");
597588
System.out.println("From onBatchFailure QA Exception");
598589
}))

marklogic-client-api-functionaltests/src/test/java/com/marklogic/client/datamovement/functionaltests/QBFailover.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@
5454
import org.w3c.dom.Node;
5555

5656
import com.marklogic.client.DatabaseClient;
57-
import com.marklogic.client.DatabaseClientFactory.Authentication;
5857
import com.marklogic.client.admin.ExtensionMetadata;
5958
import com.marklogic.client.admin.TransformExtensionsManager;
6059
import com.marklogic.client.datamovement.ApplyTransformListener;
@@ -139,9 +138,8 @@ public static void setUpBeforeClass() throws Exception {
139138
}
140139
hostLists.add("localhost");
141140
int index = new Random().nextInt(hostLists.size());
142-
dbClient = getDatabaseClientOnDatabase(hostLists.get(index), port, dbName, user, password,
143-
Authentication.DIGEST);
144-
evalClient = getDatabaseClientOnDatabase(host, port, dbName, user, password, Authentication.DIGEST);
141+
dbClient = getDatabaseClientOnDatabase(hostLists.get(index), port, dbName, user, password, getConnType());
142+
evalClient = getDatabaseClientOnDatabase(host, port, dbName, user, password, getConnType());
145143
dmManager = dbClient.newDataMovementManager();
146144
tempMgr = evalClient.newDataMovementManager();
147145
Map<String, String> props = new HashMap<>();
@@ -950,8 +948,8 @@ public void massDeleteConsistentSnapShot() throws Exception {
950948
*
951949
*
952950
*/
953-
@Ignore
954-
//@Test(timeout = 450000)
951+
952+
@Test(timeout = 450000)
955953
public void testListenerCloseables() throws Exception {
956954
Assume.assumeTrue(hostNames.length > 1);
957955

0 commit comments

Comments
 (0)