Skip to content

Commit 9085529

Browse files
Ajit GeorgeAjit George
authored andcommitted
Fixed 3 of the 4 regressions
1 parent 948eca7 commit 9085529

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

test-complete/src/test/java/com/marklogic/javaclient/TestPartialUpdate.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ public void testPartialUpdateJSON() throws IOException
122122
fragmentNode = mapper.createObjectNode();
123123
fragmentNode.put("insertedKey", 9);
124124
String fragment = mapper.writeValueAsString(fragmentNode);
125-
126-
patchBldr.insertFragment("$.employees", Position.LAST_CHILD, fragment);
125+
126+
String jsonpath = new String("$.employees[2]");
127+
patchBldr.insertFragment(jsonpath, Position.AFTER, fragment);
127128
DocumentPatchHandle patchHandle = patchBldr.build();
128129
docMgr.patch(docId, patchHandle);
129130

@@ -535,7 +536,7 @@ public void testPartialUpdateCombinationTranscRevert() throws Exception{
535536
@Test
536537
public void testPartialUpdateCombinationJSON() throws Exception{
537538
System.out.println("Running testPartialUpdateCombinationJSON");
538-
DatabaseClient client = DatabaseClientFactory.newClient("localhost", uberPort, dbName, "eval-user", "x", Authentication.DIGEST);
539+
DatabaseClient client = DatabaseClientFactory.newClient("localhost", 8011, "rest-writer", "x", Authentication.DIGEST);
539540

540541
// write docs
541542
String[] filenames = {"json-original.json"};
@@ -573,7 +574,7 @@ public void testPartialUpdateCombinationJSON() throws Exception{
573574
client.release();
574575

575576
}
576-
577+
577578
@Test
578579
public void testPartialUpdateMetadata() throws Exception{
579580
System.out.println("Running testPartialUpdateMetadata");
@@ -711,7 +712,7 @@ public void testPartialUpdateJSONDescriptor() throws IOException
711712
fragmentNode.put("insertedKey", 9);
712713
String fragment = mapper.writeValueAsString(fragmentNode);
713714

714-
patchBldr.insertFragment("$.employees", Position.LAST_CHILD, fragment);
715+
patchBldr.insertFragment("$.employees[2]", Position.AFTER, fragment);
715716
DocumentPatchHandle patchHandle = patchBldr.build();
716717

717718
docMgr.patch(desc, patchHandle);
@@ -795,7 +796,7 @@ public void testPartialUpdateJSONDescriptorTranc() throws IOException
795796
fragmentNode.put("insertedKey", 9);
796797
String fragment = mapper.writeValueAsString(fragmentNode);
797798
patchBldr.pathLanguage(PathLanguage.JSONPATH);
798-
patchBldr.insertFragment("$.employees", Position.LAST_CHILD, fragment);
799+
patchBldr.insertFragment("$.employees[2]", Position.AFTER, fragment);
799800
DocumentPatchHandle patchHandle = patchBldr.build();
800801
// Transaction t = client.openTransaction("Tranc");
801802
docMgr.patch(desc, patchHandle);//,t);

0 commit comments

Comments
 (0)