ValidateDebugSettings implements InstallServiceValidator, InstallApplicationValidator { @Override public void validate(final InstallServiceValidationContext validationContext) throws RestErrorException { validateDebugSettings( validationContext.isDebugAll(), validationContext.getDebugEvents(), validationContext.getDebugMode()); }  @Override void validate(final InstallServiceValidationContext validationContext); @Override void validate(final InstallApplicationValidationContext validationContext);  }
@Test public void testWrongDebugEventsAndAllInInstallService() { InstallServiceValidationContext context = new InstallServiceValidationContext(); context.setDebugAll(true); context.setDebugEvents(DEBUG_EVENTS); ValidatorsTestsUtils.validate( validateDebugSettings, context, CloudifyErrorMessages.DEBUG_EVENTS_AND_ALL_SET.getName()); }
@Test public void testWrongDebugEventsInInstallService() { InstallServiceValidationContext context = new InstallServiceValidationContext(); context.setDebugAll(false); context.setDebugEvents(WRONG_DEBUG_EVENTS); ValidatorsTestsUtils.validate( validateDebugSettings, context, CloudifyErrorMessages.DEBUG_EVENT_UNKNOWN.getName()); }
@Test public void testDuplicateDebugEventsInInstallService() { InstallServiceValidationContext context = new InstallServiceValidationContext(); context.setDebugAll(false); context.setDebugEvents(DUPLICATE_DEBUG_EVENTS); ValidatorsTestsUtils.validate( validateDebugSettings, context, CloudifyErrorMessages.DEBUG_EVENT_REPEATS.getName()); }
@Test public void testWrongDebugModeInInstallService() { InstallServiceValidationContext context = new InstallServiceValidationContext(); context.setDebugAll(true); context.setDebugMode(WRONG_DEBUG_MODE); ValidatorsTestsUtils.validate( validateDebugSettings, context, CloudifyErrorMessages.DEBUG_UNKNOWN_MODE.getName()); }
@Test public void testWrongDebugEventsAndAllInInstallApplication() { InstallApplicationValidationContext context = new InstallApplicationValidationContext(); context.setDebugAll(true); context.setDebugEvents(DEBUG_EVENTS); ValidatorsTestsUtils.validate( validateDebugSettings, context, CloudifyErrorMessages.DEBUG_EVENTS_AND_ALL_SET.getName()); }
@Test public void testWrongDebugEventsInInstallApplication() { InstallApplicationValidationContext context = new InstallApplicationValidationContext(); context.setDebugAll(false); context.setDebugEvents(WRONG_DEBUG_EVENTS); ValidatorsTestsUtils.validate( validateDebugSettings, context, CloudifyErrorMessages.DEBUG_EVENT_UNKNOWN.getName()); }
@Test public void testDuplicateDebugEventsInInstallApplication() { InstallApplicationValidationContext context = new InstallApplicationValidationContext(); context.setDebugAll(false); context.setDebugEvents(DUPLICATE_DEBUG_EVENTS); ValidatorsTestsUtils.validate( validateDebugSettings, context, CloudifyErrorMessages.DEBUG_EVENT_REPEATS.getName()); }
@Test public void testWrongDebugModeInInstallApplication() { InstallApplicationValidationContext context = new InstallApplicationValidationContext(); context.setDebugAll(true); context.setDebugMode(WRONG_DEBUG_MODE); ValidatorsTestsUtils.validate( validateDebugSettings, context, CloudifyErrorMessages.DEBUG_UNKNOWN_MODE.getName()); }