17
17
import com .marklogic .client .impl .SSLUtil ;
18
18
import com .marklogic .client .io .DocumentMetadataHandle ;
19
19
import com .marklogic .client .io .DocumentMetadataHandle .Capability ;
20
- import com .marklogic .client .query .QueryManager ;
21
20
import com .marklogic .mgmt .ManageClient ;
22
21
import com .marklogic .mgmt .ManageConfig ;
23
22
import com .marklogic .mgmt .resource .appservers .ServerManager ;
@@ -54,15 +53,12 @@ public abstract class ConnectedRESTQA {
54
53
protected static String http_port = null ;
55
54
protected static String fast_http_port = null ;
56
55
protected static String basePath = null ;
57
- private static String admin_port = null ;
58
56
// This needs to be a FQDN when SSL is enabled. Else localhost
59
57
private static String host_name = null ;
60
58
// This needs to be a FQDN when SSL is enabled. Else localhost
61
59
private static String ssl_host_name = null ;
62
60
private static String admin_user = null ;
63
61
private static String admin_password = null ;
64
- private static String mlRestReadUser = null ;
65
- private static String mlRestReadPassword = null ;
66
62
private static String ml_certificate_password = null ;
67
63
private static String ml_certificate_file = null ;
68
64
private static String mlDataConfigDirPath = null ;
@@ -317,7 +313,11 @@ public static void deleteDB(String dbName) {
317
313
}
318
314
319
315
public static void clearDB (int port ) {
320
- try (DatabaseClient client = newDatabaseClientBuilder ().withPort (port ).build ()) {
316
+ DatabaseClientBuilder builder = newDatabaseClientBuilder ()
317
+ .withDigestAuth (admin_user , admin_password )
318
+ .withPort (port );
319
+
320
+ try (DatabaseClient client = builder .build ()) {
321
321
// Trying an eval instead of a "DELETE v1/search", which leads to intermittent errors on Jenkins involving
322
322
// a "clear" operation on a forest failing.
323
323
String count = client .newServerEval ()
@@ -848,15 +848,6 @@ public static void configureRESTServer(String dbName, String[] fNames) throws Ex
848
848
}
849
849
}
850
850
851
- //Configure a SSL or non SSL enabled REST Server based on the build.gradle
852
- public static void configureRESTServer (String dbName , String [] fNames , boolean bAssociateDB ) throws Exception {
853
- loadGradleProperties ();
854
- if (IsSecurityEnabled ())
855
- setupJavaRESTServer (dbName , fNames [0 ], restSslServerName , getRestServerPort (), bAssociateDB );
856
- else
857
- setupJavaRESTServer (dbName , fNames [0 ], restServerName , getRestServerPort (), bAssociateDB );
858
- }
859
-
860
851
// Removes the database and forest from a REST server.
861
852
public static void cleanupRESTServer (String dbName ) {
862
853
if (IsSecurityEnabled ())
@@ -980,7 +971,6 @@ public static void loadGradleProperties() {
980
971
https_port = properties .getProperty ("httpsPort" );
981
972
http_port = properties .getProperty ("httpPort" );
982
973
fast_http_port = properties .getProperty ("marklogic.client.port" );
983
- admin_port = "8002" ; // No need yet for a property for this
984
974
basePath = properties .getProperty ("marklogic.client.basePath" );
985
975
986
976
// Machine names where ML Server runs
@@ -991,9 +981,6 @@ public static void loadGradleProperties() {
991
981
admin_user = properties .getProperty ("mlAdminUser" );
992
982
admin_password = properties .getProperty ("mlAdminPassword" );
993
983
994
- mlRestReadUser = properties .getProperty ("mlRestReadUser" );
995
- mlRestReadPassword = properties .getProperty ("mlRestReadPassword" );
996
-
997
984
// Security and Certificate properties.
998
985
ssl_enabled = properties .getProperty ("restSSLset" );
999
986
ml_certificate_password = properties .getProperty ("ml_certificate_password" );
@@ -1025,14 +1012,6 @@ public static String getAdminPassword() {
1025
1012
return admin_password ;
1026
1013
}
1027
1014
1028
- public static String getRestReaderUser () {
1029
- return mlRestReadUser ;
1030
- }
1031
-
1032
- public static String getRestReaderPassword () {
1033
- return mlRestReadPassword ;
1034
- }
1035
-
1036
1015
public static String getSslEnabled () {
1037
1016
return ssl_enabled ;
1038
1017
}
@@ -1063,10 +1042,6 @@ private static int getHttpPort() {
1063
1042
return (Integer .parseInt (http_port ));
1064
1043
}
1065
1044
1066
- public static int getAdminPort () {
1067
- return (Integer .parseInt (admin_port ));
1068
- }
1069
-
1070
1045
/*
1071
1046
* This needs to be a FQDN when SSL is enabled. Else localhost.
1072
1047
*/
0 commit comments