@@ -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