private boolean matches(String filename) { return dataHub.buildPatternForDatabasesToUpdateIndexesFor().matcher(filename).matches(); } }
/** * Installs the data hub configuration and server-side config files into MarkLogic * * @param listener - the callback method to receive status updates */ @Override public void install(HubDeployStatusListener listener) { if (!hubConfig.getHubProject().isInitialized()) { initProject(); } logger.warn("Installing the Data Hub into MarkLogic"); // in AWS setting this fails... // for now putting in try/catch try { AppConfig roleConfig = hubConfig.getAppConfig(); SimpleAppDeployer roleDeployer = new SimpleAppDeployer(getManageClient(), getAdminManager()); roleDeployer.setCommands(getSecurityCommandList()); roleDeployer.deploy(roleConfig); } catch (HttpServerErrorException e) { if (e.getStatusCode() == HttpStatus.SERVICE_UNAVAILABLE) { logger.warn("No manage client for security installs. Assuming DHS provisioning already threre"); } else { throw new DataHubConfigurationException(e); } } HubAppDeployer finalDeployer = new HubAppDeployer(getManageClient(), getAdminManager(), listener, hubConfig.newStagingClient()); finalDeployer.setCommands(buildListOfCommands()); finalDeployer.deploy(hubConfig.getAppConfig()); }
@PostConstruct public void bootstrapHub() { boolean isInstalled = false; try { isInstalled = dataHub.isInstalled().isInstalled(); } catch(Exception e) { logger.info("Datahub is not installed"); } if(! isInstalled) { dataHub.install(); try { //dataHub.upgradeHub(); // this throws exception right now. } catch (Exception e) { logger.warn("Upgrade threw an exception during test bootstrapping"); } } }
@Override public boolean isSafeToInstall() { return !(isPortInUse(DatabaseKind.FINAL) || isPortInUse(DatabaseKind.STAGING) || isPortInUse(DatabaseKind.JOB)) && isServerVersionOk(); }
portsInUse = getServerPortsInUse(); } catch (HttpClientErrorException e) { logger.warn("Used non-existing user to verify data hub. Usually this means a fresh system, ready to install."); serverVersionOk = isServerVersionValid(serverVersion); HashMap response = new HashMap(); response.put("serverVersion", serverVersion); response.put("jobPortInUse", jobPortInUse); response.put("jobPortInUseBy", jobPortInUseBy); response.put("safeToInstall", isSafeToInstall()); if ((boolean) response.get("safeToInstall")) { response.put("dhfVersion", versions.getHubVersion());
@Test public void testPreFlightCheckNoHubInstalled() { List<Namespace> list = new ArrayList<>(); expect(serverManager.getAsXml()).andReturn(new ResourcesFragment(new Fragment("<server-default-list xmlns=\"http://marklogic.com/manage/servers\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://marklogic.com/manage/servers manage-servers.xsd\"> <meta> <uri>/manage/v2/servers</uri> <current-time>2017-10-01T19:15:38.140598-04:00</current-time> <elapsed-time units=\"sec\">0.030447</elapsed-time> </meta> <relations> <relation-group array=\"true\"> <typeref>groups</typeref> <relation-count units=\"quantity\">1</relation-count> <relation array=\"true\"> <uriref>/manage/v2/groups/Default</uriref> <idref>3341249095562999141</idref> <nameref>Default</nameref> </relation> </relation-group> </relations> <list-items> <list-count units=\"quantity\">8</list-count> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/Admin?group-id=Default</uriref> <kindref>http</kindref> <content-db>Security</content-db> <idref>7776582106827683360</idref> <nameref>Admin</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/App-Services?group-id=Default</uriref> <kindref>http</kindref> <content-db>Documents</content-db> <modules-db>Modules</modules-db> <idref>4626187627163603518</idref> <nameref>App-Services</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/HealthCheck?group-id=Default</uriref> <kindref>http</kindref> <content-db>App-Services</content-db> <idref>16530884482127520539</idref> <nameref>HealthCheck</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/Manage?group-id=Default</uriref> <kindref>http</kindref> <content-db>App-Services</content-db> <idref>15392081774558336614</idref> <nameref>Manage</nameref> </list-item> </list-items> <related-views> <related-view array=\"true\"> <view-type>root</view-type> <view-name>default</view-name> <view-uri>/manage/v2</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>metrics</view-name> <view-uri>/manage/v2/servers?view=metrics</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>package</view-name> <view-uri>/manage/v2/servers?view=package</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>schema</view-name> <view-uri>/manage/v2/servers?view=schema</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>status</view-name> <view-uri>/manage/v2/servers?view=status</view-uri> </related-view> </related-views> </server-default-list>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("Admin")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>Admin</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>Admin/</root> <authentication>digest</authentication> <port>8001</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>10800</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>false</debug-allow> <profile-allow>false</profile-allow> <default-xquery-version>0.9-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>/error-switch.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>rewriter.xqy</url-rewriter> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>Security</content-database> <default-user>nobody</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("App-Services")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>App-Services</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>/</root> <authentication>digest</authentication> <port>8000</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>/MarkLogic/rest-api/8000-error-handler.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>/MarkLogic/rest-api/8000-rewriter.xml</url-rewriter> <rewrite-resolves-globally>true</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>Documents</content-database> <modules-database>Modules</modules-database> <default-user>nobody</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("HealthCheck")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>HealthCheck</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>HealthCheck/</root> <authentication>application-level</authentication> <port>7997</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>2</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler/> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter/> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>App-Services</content-database> <default-user>healthcheck</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("Manage")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>Manage</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>Apps/</root> <authentication>digest</authentication> <port>8002</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>manage/error-handler.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>manage/rewriter.xqy</url-rewriter> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>App-Services</content-database> <default-user>nobody</default-user> <privilege>http://marklogic.com/xdmp/privileges/manage</privilege> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(versions.getMarkLogicVersion()).andReturn("9.0-6"); replay(dh, serverManager, versions); dh.runPreInstallCheck(); assertTrue(dh.isServerVersionOk()); assertFalse(dh.isPortInUse(DatabaseKind.STAGING)); assertFalse(dh.isPortInUse(DatabaseKind.FINAL)); assertFalse(dh.isPortInUse(DatabaseKind.JOB)); assertTrue(dh.isSafeToInstall()); }
@Test public void testValidateServer809() { assertFalse(dh.isServerVersionValid("8.0-9")); }
@Override public boolean upgradeHub(List<String> updatedFlows) throws CantUpgradeException { boolean isHubInstalled = this.isInstalled().isInstalled(); String currentVersion = versions.getHubVersion(); runInDatabase("cts:uris(\"\", (), cts:and-not-query(cts:collection-query(\"hub-core-module\"), cts:document-query((\"/com.marklogic.hub/config.sjs\", \"/com.marklogic.hub/config.xqy\")))) ! xdmp:document-delete(.)", hubConfig.getDbName(DatabaseKind.MODULES)); this.hubInstallModules(); this.loadUserModules();
/** * Note that this differs from how "mlUpdateIndexes" works in ml-gradle. This is not stripping out any "non-index" * properties from each payload - it's just updating every database. * * This does however disable forest creation which speeds up the process so that the only calls made are to * update the databases. */ @Override public void updateIndexes() { SimpleAppDeployer deployer = new SimpleAppDeployer(getManageClient(), getAdminManager()); deployer.setCommands(buildCommandMap().get("mlDatabaseCommands")); AppConfig appConfig = hubConfig.getAppConfig(); final boolean originalCreateForests = appConfig.isCreateForests(); final Pattern originalIncludePattern = appConfig.getResourceFilenamesIncludePattern(); try { appConfig.setCreateForests(false); if (hubConfig.getIsProvisionedEnvironment()) { appConfig.setResourceFilenamesIncludePattern(buildPatternForDatabasesToUpdateIndexesFor()); } deployer.deploy(hubConfig.getAppConfig()); } finally { appConfig.setCreateForests(originalCreateForests); appConfig.setResourceFilenamesIncludePattern(originalIncludePattern); } }
@PostConstruct public void teardownHub() { super.init(); dataHub.initProject(); dataHub.uninstall(); if (isCertAuth() || isSslRun()) { ManageClient manageClient = ((HubConfigImpl)getHubAdminConfig()).getManageClient();
@BeforeEach public void setup() { deleteProjectDir(); createProjectDir(); dataHub.initProject(); }
@Override public boolean upgradeHub() throws CantUpgradeException { return upgradeHub(null); }
/** * Installs the data hub configuration and server-side config files into MarkLogic */ @Override public void install() { install(null); }
/** * Uninstalls the data hub configuration and server-side config files from MarkLogic */ @Override public void uninstall() { uninstall(null); }
@Test public void testPreFlightCheckStagingPortTakenAndBadVersion() { List<Namespace> list = new ArrayList<>(); expect(serverManager.getAsXml()).andReturn(new ResourcesFragment(new Fragment("<server-default-list xmlns=\"http://marklogic.com/manage/servers\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://marklogic.com/manage/servers manage-servers.xsd\"> <meta> <uri>/manage/v2/servers</uri> <current-time>2017-10-01T19:15:38.140598-04:00</current-time> <elapsed-time units=\"sec\">0.030447</elapsed-time> </meta> <relations> <relation-group array=\"true\"> <typeref>groups</typeref> <relation-count units=\"quantity\">1</relation-count> <relation array=\"true\"> <uriref>/manage/v2/groups/Default</uriref> <idref>3341249095562999141</idref> <nameref>Default</nameref> </relation> </relation-group> </relations> <list-items> <list-count units=\"quantity\">8</list-count> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/Admin?group-id=Default</uriref> <kindref>http</kindref> <content-db>Security</content-db> <idref>7776582106827683360</idref> <nameref>Admin</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/App-Services?group-id=Default</uriref> <kindref>http</kindref> <content-db>Documents</content-db> <modules-db>Modules</modules-db> <idref>4626187627163603518</idref> <nameref>App-Services</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/port-stealer?group-id=Default</uriref> <kindref>http</kindref> <content-db>data-hub-STAGING</content-db> <modules-db>data-hub-MODULES</modules-db> <idref>10842453788764821876</idref> <nameref>port-stealer</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/HealthCheck?group-id=Default</uriref> <kindref>http</kindref> <content-db>App-Services</content-db> <idref>16530884482127520539</idref> <nameref>HealthCheck</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/Manage?group-id=Default</uriref> <kindref>http</kindref> <content-db>App-Services</content-db> <idref>15392081774558336614</idref> <nameref>Manage</nameref> </list-item> </list-items> <related-views> <related-view array=\"true\"> <view-type>root</view-type> <view-name>default</view-name> <view-uri>/manage/v2</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>metrics</view-name> <view-uri>/manage/v2/servers?view=metrics</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>package</view-name> <view-uri>/manage/v2/servers?view=package</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>schema</view-name> <view-uri>/manage/v2/servers?view=schema</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>status</view-name> <view-uri>/manage/v2/servers?view=status</view-uri> </related-view> </related-views> </server-default-list>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("Admin")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>Admin</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>Admin/</root> <authentication>digest</authentication> <port>8001</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>10800</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>false</debug-allow> <profile-allow>false</profile-allow> <default-xquery-version>0.9-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>/error-switch.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>rewriter.xqy</url-rewriter> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>Security</content-database> <default-user>nobody</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("App-Services")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>App-Services</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>/</root> <authentication>digest</authentication> <port>8000</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>/MarkLogic/rest-api/8000-error-handler.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>/MarkLogic/rest-api/8000-rewriter.xml</url-rewriter> <rewrite-resolves-globally>true</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>Documents</content-database> <modules-database>Modules</modules-database> <default-user>nobody</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("port-stealer")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>port-stealer</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>/</root> <port>8010</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <authentication>digest</authentication> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>true</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>json</default-error-format> <error-handler>/MarkLogic/rest-api/error-handler.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>/MarkLogic/rest-api/rewriter.xml</url-rewriter> <rewrite-resolves-globally>true</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>data-hub-FINAL</content-database> <modules-database>data-hub-MODULES</modules-database> <default-user>nobody</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("HealthCheck")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>HealthCheck</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>HealthCheck/</root> <authentication>application-level</authentication> <port>7997</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>2</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler/> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter/> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>App-Services</content-database> <default-user>healthcheck</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("Manage")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>Manage</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>Apps/</root> <authentication>digest</authentication> <port>8002</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>manage/error-handler.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>manage/rewriter.xqy</url-rewriter> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>App-Services</content-database> <default-user>nobody</default-user> <privilege>http://marklogic.com/xdmp/privileges/manage</privilege> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(versions.getMarkLogicVersion()).andReturn("9.0-1"); replay(dh, versions, serverManager); dh.runPreInstallCheck(); assertFalse(dh.isServerVersionOk()); assertTrue(dh.isPortInUse(DatabaseKind.STAGING)); assertEquals("port-stealer", dh.getPortInUseBy(DatabaseKind.STAGING)); assertFalse(dh.isPortInUse(DatabaseKind.FINAL)); assertFalse(dh.isPortInUse(DatabaseKind.JOB)); assertFalse(dh.isSafeToInstall()); }
@Test public void testValidateServerBeyond905() { assertTrue(dh.isServerVersionValid("9.0-6.1")); }
@BeforeEach public void setup() throws IOException, URISyntaxException { XMLUnit.setIgnoreWhitespace(true); enableDebugging(); clearDatabases(HubConfig.DEFAULT_STAGING_NAME, HubConfig.DEFAULT_JOB_NAME, HubConfig.DEFAULT_FINAL_NAME); clearUserModules(); deleteProjectDir(); createProjectDir(); dataHub.initProject(); FileUtils.copyDirectory( new File("src/test/resources/tracing-test/plugins"), new File(PROJECT_PATH + "/plugins") ); installUserModules(adminHubConfig, true); //Disable tracing that may have been enabled in previous tests Tracing.create(flowRunnerClient).disable(); }
@Test public void upgrade300To403ToCurrentVersion() throws Exception { Assumptions.assumeFalse((isCertAuth() || isSslRun())); final String projectPath = "build/tmp/upgrade-projects/dhf403from300"; final File projectDir = Paths.get(projectPath).toFile(); FileUtils.deleteDirectory(projectDir); FileUtils.copyDirectory(Paths.get("src/test/resources/upgrade-projects/dhf403from300").toFile(), projectDir); resetProperties(); adminHubConfig.createProject(projectDir.getAbsolutePath()); adminHubConfig.refreshProject(); dataHub.upgradeHub(); // Confirm that the directories have been backed up Assertions.assertTrue(adminHubConfig.getHubProject().getProjectDir() .resolve("src/main/hub-internal-config-4.0.3").toFile().exists()); //This file should be present in backed up location Assertions.assertTrue(adminHubConfig.getHubProject().getProjectDir() .resolve("src/main/hub-internal-config-4.0.3/databases/final-database.json").toFile().exists()); Assertions.assertTrue(adminHubConfig.getHubProject().getProjectDir() .resolve("src/main/ml-config-4.0.3").toFile().exists()); } }
@Test public void testPreFlightCheckFinalPortTaken() { List<Namespace> list = new ArrayList<>(); expect(serverManager.getAsXml()).andReturn(new ResourcesFragment(new Fragment("<server-default-list xmlns=\"http://marklogic.com/manage/servers\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://marklogic.com/manage/servers manage-servers.xsd\"> <meta> <uri>/manage/v2/servers</uri> <current-time>2017-10-01T19:15:38.140598-04:00</current-time> <elapsed-time units=\"sec\">0.030447</elapsed-time> </meta> <relations> <relation-group array=\"true\"> <typeref>groups</typeref> <relation-count units=\"quantity\">1</relation-count> <relation array=\"true\"> <uriref>/manage/v2/groups/Default</uriref> <idref>3341249095562999141</idref> <nameref>Default</nameref> </relation> </relation-group> </relations> <list-items> <list-count units=\"quantity\">8</list-count> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/Admin?group-id=Default</uriref> <kindref>http</kindref> <content-db>Security</content-db> <idref>7776582106827683360</idref> <nameref>Admin</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/App-Services?group-id=Default</uriref> <kindref>http</kindref> <content-db>Documents</content-db> <modules-db>Modules</modules-db> <idref>4626187627163603518</idref> <nameref>App-Services</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/port-stealer?group-id=Default</uriref> <kindref>http</kindref> <content-db>data-hub-STAGING</content-db> <modules-db>data-hub-MODULES</modules-db> <idref>10842453788764821876</idref> <nameref>port-stealer</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/HealthCheck?group-id=Default</uriref> <kindref>http</kindref> <content-db>App-Services</content-db> <idref>16530884482127520539</idref> <nameref>HealthCheck</nameref> </list-item> <list-item array=\"true\"> <relation-id>3341249095562999141</relation-id> <groupnameref>Default</groupnameref> <uriref>/manage/v2/servers/Manage?group-id=Default</uriref> <kindref>http</kindref> <content-db>App-Services</content-db> <idref>15392081774558336614</idref> <nameref>Manage</nameref> </list-item> </list-items> <related-views> <related-view array=\"true\"> <view-type>root</view-type> <view-name>default</view-name> <view-uri>/manage/v2</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>metrics</view-name> <view-uri>/manage/v2/servers?view=metrics</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>package</view-name> <view-uri>/manage/v2/servers?view=package</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>schema</view-name> <view-uri>/manage/v2/servers?view=schema</view-uri> </related-view> <related-view array=\"true\"> <view-type>list</view-type> <view-name>status</view-name> <view-uri>/manage/v2/servers?view=status</view-uri> </related-view> </related-views> </server-default-list>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("Admin")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>Admin</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>Admin/</root> <authentication>digest</authentication> <port>8001</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>10800</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>false</debug-allow> <profile-allow>false</profile-allow> <default-xquery-version>0.9-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>/error-switch.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>rewriter.xqy</url-rewriter> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>Security</content-database> <default-user>nobody</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("App-Services")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>App-Services</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>/</root> <authentication>digest</authentication> <port>8000</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>/MarkLogic/rest-api/8000-error-handler.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>/MarkLogic/rest-api/8000-rewriter.xml</url-rewriter> <rewrite-resolves-globally>true</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>Documents</content-database> <modules-database>Modules</modules-database> <default-user>nobody</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("port-stealer")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>port-stealer</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>/</root> <port>8011</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <authentication>digest</authentication> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>true</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>json</default-error-format> <error-handler>/MarkLogic/rest-api/error-handler.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>/MarkLogic/rest-api/rewriter.xml</url-rewriter> <rewrite-resolves-globally>true</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>data-hub-FINAL</content-database> <modules-database>data-hub-MODULES</modules-database> <default-user>nobody</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("HealthCheck")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>HealthCheck</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>HealthCheck/</root> <authentication>application-level</authentication> <port>7997</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>2</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler/> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter/> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>App-Services</content-database> <default-user>healthcheck</default-user> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(serverManager.getPropertiesAsXml("Manage")).andReturn(new ResourcesFragment(new Fragment("<http-server-properties xmlns=\"http://marklogic.com/manage\"> <server-name>Manage</server-name> <group-name>Default</group-name> <server-type>http</server-type> <enabled>true</enabled> <root>Apps/</root> <authentication>digest</authentication> <port>8002</port> <webDAV>false</webDAV> <execute>true</execute> <display-last-login>false</display-last-login> <address>0.0.0.0</address> <backlog>512</backlog> <threads>32</threads> <request-timeout>30</request-timeout> <keep-alive-timeout>5</keep-alive-timeout> <session-timeout>3600</session-timeout> <max-time-limit>3600</max-time-limit> <default-time-limit>600</default-time-limit> <max-inference-size>500</max-inference-size> <default-inference-size>100</default-inference-size> <static-expires>3600</static-expires> <pre-commit-trigger-depth>1000</pre-commit-trigger-depth> <pre-commit-trigger-limit>10000</pre-commit-trigger-limit> <collation>http://marklogic.com/collation/</collation> <internal-security>true</internal-security> <concurrent-request-limit>0</concurrent-request-limit> <compute-content-length>true</compute-content-length> <log-errors>false</log-errors> <debug-allow>true</debug-allow> <profile-allow>true</profile-allow> <default-xquery-version>1.0-ml</default-xquery-version> <multi-version-concurrency-control>contemporaneous</multi-version-concurrency-control> <distribute-timestamps>fast</distribute-timestamps> <output-sgml-character-entities>none</output-sgml-character-entities> <output-encoding>UTF-8</output-encoding> <output-method>default</output-method> <output-byte-order-mark>default</output-byte-order-mark> <output-cdata-section-namespace-uri/> <output-cdata-section-localname/> <output-doctype-public/> <output-doctype-system/> <output-escape-uri-attributes>default</output-escape-uri-attributes> <output-include-content-type>default</output-include-content-type> <output-indent>default</output-indent> <output-indent-untyped>default</output-indent-untyped> <output-indent-tabs>default</output-indent-tabs> <output-media-type/> <output-normalization-form>none</output-normalization-form> <output-omit-xml-declaration>default</output-omit-xml-declaration> <output-standalone>omit</output-standalone> <output-undeclare-prefixes>default</output-undeclare-prefixes> <output-version/> <output-include-default-attributes>default</output-include-default-attributes> <default-error-format>compatible</default-error-format> <error-handler>manage/error-handler.xqy</error-handler> <schemas/> <namespaces/> <module-locations/> <request-blackouts/> <url-rewriter>manage/rewriter.xqy</url-rewriter> <rewrite-resolves-globally>false</rewrite-resolves-globally> <ssl-allow-sslv3>true</ssl-allow-sslv3> <ssl-allow-tls>true</ssl-allow-tls> <ssl-disable-sslv3>false</ssl-disable-sslv3> <ssl-disable-tlsv1>false</ssl-disable-tlsv1> <ssl-disable-tlsv1-1>false</ssl-disable-tlsv1-1> <ssl-disable-tlsv1-2>false</ssl-disable-tlsv1-2> <ssl-hostname/> <ssl-ciphers>ALL:!LOW:@STRENGTH</ssl-ciphers> <ssl-require-client-certificate>true</ssl-require-client-certificate> <content-database>App-Services</content-database> <default-user>nobody</default-user> <privilege>http://marklogic.com/xdmp/privileges/manage</privilege> </http-server-properties>", list.toArray(new Namespace[] {})))); expect(versions.getMarkLogicVersion()).andReturn("9.0-6"); replay(dh, versions, serverManager); dh.runPreInstallCheck(); assertTrue(dh.isServerVersionOk()); assertFalse(dh.isPortInUse(DatabaseKind.STAGING)); assertTrue(dh.isPortInUse(DatabaseKind.FINAL)); assertEquals("port-stealer", dh.getPortInUseBy(DatabaseKind.FINAL)); assertFalse(dh.isPortInUse(DatabaseKind.JOB)); assertFalse(dh.isSafeToInstall()); } }
@Test public void testValidateServer804() { assertFalse(dh.isServerVersionValid("8.0-4")); }