public void createProjectDir() { createProjectDir(PROJECT_PATH); }
protected void debugOutput(Document xmldoc) { debugOutput(xmldoc, System.out); }
protected int getTracingDocCount(String collection) { return getDocCount(HubConfig.DEFAULT_JOB_NAME, collection); }
@PostConstruct protected void init() { createProjectDir(); adminHubConfig.createProject(PROJECT_PATH); if(! project.isInitialized()) { boolean sslFinal = Boolean.parseBoolean(properties.getProperty("mlFinalSimpleSsl")); if(sslStaging && sslJob && sslFinal){ setSslRun(true); setCertAuth(true); stagingClient = getClient(host, stagingPort, HubConfig.DEFAULT_STAGING_NAME, user, password, stagingAuthMethod); flowRunnerClient = getClient(host, stagingPort, HubConfig.DEFAULT_STAGING_NAME, flowRunnerUser, flowRunnerPassword, stagingAuthMethod); finalFlowRunnerClient = getClient(host, stagingPort, HubConfig.DEFAULT_FINAL_NAME, flowRunnerUser, flowRunnerPassword, stagingAuthMethod); stagingModulesClient = getClient(host, stagingPort, HubConfig.DEFAULT_MODULES_DB_NAME, manageUser, managePassword, stagingAuthMethod); finalClient = getClient(host, stagingPort, HubConfig.DEFAULT_FINAL_NAME, user, password, finalAuthMethod); jobClient = getClient(host, jobPort, HubConfig.DEFAULT_JOB_NAME, user, password, jobAuthMethod); jobModulesClient = getClient(host, stagingPort, HubConfig.DEFAULT_MODULES_DB_NAME, manageUser, managePassword, jobAuthMethod); if(isSslRun() || isCertAuth()) { certInit();
protected HubConfigImpl getHubAdminConfig() { if (isSslRun() || isCertAuth()) { certInit(); } adminHubConfig.setMlUsername(user); adminHubConfig.setMlPassword(password); wireClients(); return adminHubConfig; }
protected void installModule(String path, String localPath) { InputStreamHandle handle = new InputStreamHandle(HubTestBase.class.getClassLoader().getResourceAsStream(localPath)); String ext = FilenameUtils.getExtension(path); DocumentMetadataHandle permissions = new DocumentMetadataHandle() .withPermission(getHubAdminConfig().getHubRoleName(), DocumentMetadataHandle.Capability.EXECUTE, UPDATE, READ); switch(ext) { case "xml": handle.setFormat(Format.XML); break; case "json": handle.setFormat(Format.JSON); break; default: handle.setFormat(Format.TEXT); } modMgr.write(path, permissions, handle); clearFlowCache(); }
protected int getFinalDocCount() { return getFinalDocCount(null); } protected int getFinalDocCount(String collection) {
protected int getJobDocCount() { return getJobDocCount("job"); } protected int getJobDocCount(String collection) {
public void clearUserModules() { getDataHub().clearUserModules(); }
protected void uninstallModule(String path) { ServerEvaluationCall eval = stagingClient.newServerEval(); String installer = "xdmp:invoke-function(function() {" + " xdmp:document-delete(\"" + path + "\")" + "}," + "<options xmlns=\"xdmp:eval\">" + " <database>{xdmp:modules-database()}</database>" + " <transaction-mode>update-auto-commit</transaction-mode>" + "</options>)"; eval.xquery(installer).eval(); clearFlowCache(); }
protected HubConfig getHubAdminConfig(String projectDir) { if (isSslRun() || isCertAuth()) { certInit(); } adminHubConfig.setMlUsername(user); adminHubConfig.setMlPassword(password); wireClients(); return adminHubConfig; }
protected void installModules(Map<String, String> modules) { DocumentWriteSet writeSet = modMgr.newWriteSet(); modules.forEach((String path, String localPath) -> { InputStreamHandle handle = new InputStreamHandle(HubTestBase.class.getClassLoader().getResourceAsStream(localPath)); String ext = FilenameUtils.getExtension(path); switch(ext) { case "xml": handle.setFormat(Format.XML); break; case "json": handle.setFormat(Format.JSON); break; default: handle.setFormat(Format.TEXT); } DocumentMetadataHandle permissions = new DocumentMetadataHandle() .withPermission(getHubAdminConfig().getHubRoleName(), DocumentMetadataHandle.Capability.EXECUTE, UPDATE, READ); writeSet.add(path, permissions, handle); }); modMgr.write(writeSet); clearFlowCache(); }
protected int getJobDocCount(String collection) { return getDocCount(HubConfig.DEFAULT_JOB_NAME, collection); }
protected void basicSetup() { XMLUnit.setIgnoreWhitespace(true); createProjectDir(); }
protected int getStagingDocCount(String collection) { return getDocCount(HubConfig.DEFAULT_STAGING_NAME, collection); }
protected int getFinalDocCount(String collection) { return getDocCount(HubConfig.DEFAULT_FINAL_NAME, collection); }