@@ -36,6 +36,8 @@ public class TestPartialUpdate extends BasicJavaClientREST {
3636 private static String [] fNames = {"TestPartialUpdateDB-1" };
3737 private static String restServerName = "REST-Java-Client-API-Server" ;
3838 private static int restPort =8011 ;
39+ // Additional port to test for Uber port
40+ private static int uberPort = 8000 ;
3941
4042 @ BeforeClass
4143 public static void setUp () throws Exception
@@ -44,6 +46,9 @@ public static void setUp() throws Exception
4446 System .setProperty ("org.apache.commons.logging.simplelog.log.org.apache.http.wire" , "debug" );
4547 setupJavaRESTServer (dbName , fNames [0 ], restServerName ,8011 );
4648 setupAppServicesConstraint (dbName );
49+
50+ createUserRolesWithPrevilages ("test-eval" ,"xdbc:eval" , "xdbc:eval-in" ,"xdmp:eval-in" ,"any-uri" ,"xdbc:invoke" );
51+ createRESTUser ("eval-user" , "x" , "test-eval" ,"rest-admin" ,"rest-writer" ,"rest-reader" );
4752 }
4853
4954 @ After
@@ -60,7 +65,7 @@ public void testPartialUpdateXML() throws IOException
6065
6166 String [] filenames = {"constraint1.xml" , "constraint2.xml" , "constraint3.xml" , "constraint4.xml" , "constraint5.xml" };
6267
63- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
68+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
6469
6570 // write docs
6671 for (String filename : filenames )
@@ -93,7 +98,7 @@ public void testPartialUpdateJSON() throws IOException
9398
9499 String [] filenames = {"json-original.json" };
95100
96- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
101+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
97102
98103 // write docs
99104 for (String filename : filenames )
@@ -133,7 +138,7 @@ public void testPartialUpdateContent() throws IOException
133138
134139 String filename = "constraint1.xml" ;
135140
136- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
141+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
137142
138143 // write docs
139144 writeDocumentUsingInputStreamHandle (client , filename , "/partial-update/" , "XML" );
@@ -223,7 +228,7 @@ public void testPartialUpdateDeletePath() throws IOException
223228 {
224229 System .out .println ("Running testPartialUpdateDeletePath" );
225230
226- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
231+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
227232
228233 // write docs
229234 String filename = "constraint1.xml" ;
@@ -263,7 +268,7 @@ public void testPartialUpdateDeletePath() throws IOException
263268 @ Test
264269 public void testPartialUpdateFragments () throws Exception {
265270 System .out .println ("Running testPartialUpdateFragments" );
266- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
271+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
267272
268273 // write docs
269274 String filename = "constraint1.xml" ;
@@ -298,7 +303,7 @@ public void testPartialUpdateFragments() throws Exception{
298303 @ Test
299304 public void testPartialUpdateInsertFragments () throws Exception {
300305 System .out .println ("Running testPartialUpdateInsertFragments" );
301- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
306+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
302307
303308 // write docs
304309 String filename = "constraint1.xml" ;
@@ -331,7 +336,7 @@ public void testPartialUpdateInsertFragments() throws Exception{
331336 @ Test
332337 public void testPartialUpdateInsertExistingFragments () throws Exception {
333338 System .out .println ("Running testPartialUpdateInsertExistingFragments" );
334- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
339+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
335340
336341 // write docs
337342 String filename = "constraint1.xml" ;
@@ -364,7 +369,7 @@ public void testPartialUpdateInsertExistingFragments() throws Exception{
364369 @ Test
365370 public void testPartialUpdateReplaceApply () throws Exception {
366371 System .out .println ("Running testPartialUpdateReplaceApply" );
367- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-admin" , "x" , Authentication .DIGEST );
372+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8000 , "rest-admin" , "x" , Authentication .DIGEST );
368373 ExtensionLibrariesManager libsMgr = client .newServerConfigManager ().newExtensionLibrariesManager ();
369374
370375 libsMgr .write ("/ext/patch/custom-lib.xqy" , new FileHandle (new File ("src/test/java/com/marklogic/javaclient/data/custom-lib.xqy" )).withFormat (Format .TEXT ));
@@ -417,7 +422,7 @@ public void testPartialUpdateReplaceApply() throws Exception{
417422 @ Test
418423 public void testPartialUpdateCombination () throws Exception {
419424 System .out .println ("Running testPartialUpdateCombination" );
420- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
425+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
421426
422427 // write docs
423428 String filename = "constraint1.xml" ;
@@ -446,7 +451,7 @@ public void testPartialUpdateCombination() throws Exception{
446451 @ Test
447452 public void testPartialUpdateCombinationTransc () throws Exception {
448453 System .out .println ("Running testPartialUpdateCombination" );
449- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
454+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
450455 Transaction t = client .openTransaction ("Transac" );
451456 // write docs
452457 String filename = "constraint1.xml" ;
@@ -481,7 +486,7 @@ public void testPartialUpdateCombinationTransc() throws Exception{
481486 @ Test
482487 public void testPartialUpdateCombinationTranscRevert () throws Exception {
483488 System .out .println ("Running testPartialUpdateCombinationTranscRevert" );
484- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
489+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
485490 // write docs
486491 String [] filenames = {"constraint1.xml" , "constraint2.xml" };
487492 for (String filename : filenames )
@@ -524,7 +529,7 @@ public void testPartialUpdateCombinationTranscRevert() throws Exception{
524529 @ Test
525530 public void testPartialUpdateCombinationJSON () throws Exception {
526531 System .out .println ("Running testPartialUpdateCombinationJSON" );
527- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
532+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
528533
529534 // write docs
530535 String [] filenames = {"json-original.json" };
@@ -566,7 +571,7 @@ public void testPartialUpdateCombinationJSON() throws Exception{
566571 @ Test
567572 public void testPartialUpdateMetadata () throws Exception {
568573 System .out .println ("Running testPartialUpdateMetadata" );
569- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
574+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
570575
571576 // write docs
572577 String filename = "constraint1.xml" ;
@@ -638,7 +643,7 @@ public void testPartialUpdateXMLDscriptor() throws IOException
638643
639644 String [] filenames = {"constraint1.xml" , "constraint2.xml" , "constraint3.xml" , "constraint4.xml" , "constraint5.xml" };
640645
641- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
646+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
642647
643648 // write docs
644649 for (String filename : filenames )
@@ -675,7 +680,7 @@ public void testPartialUpdateJSONDescriptor() throws IOException
675680
676681 String [] filenames = {"json-original.json" };
677682
678- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
683+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
679684
680685 // write docs
681686 for (String filename : filenames )
@@ -722,7 +727,7 @@ public void testPartialUpdateXMLDscriptorTranc() throws IOException
722727
723728 String [] filenames = {"constraint1.xml" , "constraint2.xml" , "constraint3.xml" , "constraint4.xml" , "constraint5.xml" };
724729
725- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
730+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
726731
727732 // write docs
728733 for (String filename : filenames )
@@ -761,7 +766,7 @@ public void testPartialUpdateJSONDescriptorTranc() throws IOException
761766
762767 String [] filenames = {"json-original.json" };
763768
764- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
769+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
765770
766771 // write docs
767772 for (String filename : filenames )
@@ -806,7 +811,7 @@ public void testPartialUpdateCardinality() throws IOException
806811
807812 String filename = "constraint1.xml" ;
808813
809- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
814+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
810815
811816 // write docs
812817 writeDocumentUsingInputStreamHandle (client , filename , "/partial-update/" , "XML" );
@@ -859,7 +864,7 @@ public void testPartialUpdateReplaceValueJSON() throws IOException, JSONExceptio
859864
860865 String [] filenames = {"json-original.json" };
861866
862- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
867+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
863868
864869 // write docs
865870 for (String filename : filenames )
@@ -903,7 +908,7 @@ public void testPartialUpdateReplaceFragmentJSON() throws IOException, JSONExcep
903908
904909 String [] filenames = {"json-original.json" };
905910
906- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
911+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
907912
908913 // write docs
909914 for (String filename : filenames )
@@ -947,7 +952,7 @@ public void testPartialUpdateReplaceInsertFragmentNewJSON() throws IOException,
947952
948953 String [] filenames = {"json-original.json" };
949954
950- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
955+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
951956
952957 // write docs
953958 for (String filename : filenames )
@@ -992,7 +997,7 @@ public void testPartialUpdateReplaceInsertFragmentExistingJSON() throws IOExcept
992997
993998 String [] filenames = {"json-original.json" };
994999
995- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
1000+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
9961001
9971002 // write docs
9981003 for (String filename : filenames )
@@ -1036,7 +1041,7 @@ public void testPartialUpdateDeleteJSON() throws IOException, JSONException
10361041
10371042 String [] filenames = {"json-original.json" };
10381043
1039- DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , 8011 , "rest-writer " , "x" , Authentication .DIGEST );
1044+ DatabaseClient client = DatabaseClientFactory .newClient ("localhost" , uberPort , dbName , "eval-user " , "x" , Authentication .DIGEST );
10401045
10411046 // write docs
10421047 for (String filename : filenames )
0 commit comments