@Test public void testAutoStartFalse() throws Exception { PrerequisiteCheck check = new PrerequisiteCheck(CheckDescription.AUTO_START_DISABLED, "foo"); PrereqCheckRequest request = new PrereqCheckRequest("cluster"); Assert.assertTrue(m_check.isApplicable(request)); m_configMap.put(AutoStartDisabledCheck.RECOVERY_ENABLED_KEY, "false"); m_check.perform(check, request); Assert.assertEquals(PrereqCheckStatus.PASS, check.getStatus()); Assert.assertTrue(StringUtils.isBlank(check.getFailReason())); }
@Override public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException { String autoStartEnabled = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_ENABLED_KEY); if (!Boolean.valueOf(autoStartEnabled)) { return; } String recoveryType = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_TYPE_KEY); if (StringUtils.equals(recoveryType, RECOVERY_AUTO_START)) { prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request)); prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL); prerequisiteCheck.getFailedOn().add(request.getClusterName()); } }
AutoStartDisabledCheck extends AbstractCheckDescriptor { @Override public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException { String autoStartEnabled = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_ENABLED_KEY); if (!Boolean.valueOf(autoStartEnabled)) { return; } String recoveryType = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_TYPE_KEY); if (StringUtils.equals(recoveryType, RECOVERY_AUTO_START)) { prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request)); prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL); prerequisiteCheck.getFailedOn().add(request.getClusterName()); } } }
AutoStartDisabledCheck extends AbstractCheckDescriptor { @Override public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException { String autoStartEnabled = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_ENABLED_KEY); if (!Boolean.valueOf(autoStartEnabled)) { return; } String recoveryType = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_TYPE_KEY); if (StringUtils.equals(recoveryType, RECOVERY_AUTO_START)) { prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request)); prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL); prerequisiteCheck.getFailedOn().add(request.getClusterName()); } } AutoStartDisabledCheck(); }
AutoStartDisabledCheck extends AbstractCheckDescriptor { @Override public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException { String autoStartEnabled = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_ENABLED_KEY); if (!Boolean.valueOf(autoStartEnabled)) { return; } String recoveryType = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_TYPE_KEY); if (StringUtils.equals(recoveryType, RECOVERY_AUTO_START)) { prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request)); prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL); prerequisiteCheck.getFailedOn().add(request.getClusterName()); } } AutoStartDisabledCheck(); @Override void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request); }
AutoStartDisabledCheck extends AbstractCheckDescriptor { @Override public void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request) throws AmbariException { String autoStartEnabled = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_ENABLED_KEY); if (!Boolean.valueOf(autoStartEnabled)) { return; } String recoveryType = getProperty(request, CLUSTER_ENV_TYPE, RECOVERY_TYPE_KEY); if (StringUtils.equals(recoveryType, RECOVERY_AUTO_START)) { prerequisiteCheck.setFailReason(getFailReason(prerequisiteCheck, request)); prerequisiteCheck.setStatus(PrereqCheckStatus.FAIL); prerequisiteCheck.getFailedOn().add(request.getClusterName()); } } AutoStartDisabledCheck(); @Override void perform(PrerequisiteCheck prerequisiteCheck, PrereqCheckRequest request);  }