boolean alreadyInitialized = project.isInitialized(); try {
@Test public void initializeProject() { assertEquals(0, ((Collection<ProjectInfo>)pc.getProjects().get("projects")).size()); pc.addProject(projectPath); assertEquals(1, ((Collection<ProjectInfo>)pc.getProjects().get("projects")).size()); ObjectMapper objectMapper = new ObjectMapper(); pc.initializeProject(1, objectMapper.valueToTree(adminHubConfig)); // assertTrue(pc.getProject(1).isInitialized()); assertTrue(adminHubConfig.getHubProject().isInitialized()); }
@Test public void getProject() { assertEquals(0, ((Collection<ProjectInfo>)pc.getProjects().get("projects")).size()); assertEquals(false, pc.getProjects().keySet().contains("lastProject")); pc.addProject(projectPath); Project project = pc.getProject(1); assertEquals(projectPath, project.path); assertEquals(1, project.id); assertEquals(false, adminHubConfig.getHubProject().isInitialized()); }
@Test public void addProject() throws IOException { assertEquals(0, ((Collection<ProjectInfo>)pc.getProjects().get("projects")).size()); Project project = pc.addProject(projectPath); assertEquals(projectPath, project.path); assertEquals(1, project.id); assertEquals(false, adminHubConfig.getHubProject().isInitialized()); }
/** * 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()); }