Tabnine Logo
ResourceConfigs.validateTree
Code IndexAdd Tabnine to your IDE (free)

How to use
validateTree
method
in
com.thoughtworks.go.config.ResourceConfigs

Best Java code snippets using com.thoughtworks.go.config.ResourceConfigs.validateTree (Showing top 5 results out of 315)

origin: gocd/gocd

public boolean validateTree(ValidationContext validationContext) {
  validate(validationContext);
  boolean isValid = errors().isEmpty();
  isValid = resourceConfigs.validateTree(validationContext) && isValid;
  return isValid;
}
public void validate(ValidationContext validationContext) {
origin: gocd/gocd

public boolean validateTree(ValidationContext validationContext) {
  validate(validationContext);
  boolean isValid = errors.isEmpty();
  ValidationContext contextForChildren = validationContext.withParent(this);
  isValid = tasks.validateTree(contextForChildren) && isValid;
  isValid = variables.validateTree(contextForChildren) && isValid;
  isValid = resourceConfigs.validateTree(contextForChildren) && isValid;
  isValid = artifactPropertiesConfig.validateTree(contextForChildren) && isValid;
  isValid = tabs.validateTree(contextForChildren) && isValid;
  isValid = artifactConfigs.validateTree(contextForChildren) && isValid;
  return isValid;
}
origin: gocd/gocd

EnvironmentVariablesConfig variables = mock(EnvironmentVariablesConfig.class);
when(tasks.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(false);
when(resourceConfigs.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(false);
when(properties.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(false);
when(artifactConfigs.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(false);
PipelineConfigSaveValidationContext childContext = captor.getValue();
assertThat(childContext.getParent(), is(jobConfig));
verify(resourceConfigs).validateTree(childContext);
verify(properties).validateTree(childContext);
verify(artifactConfigs).validateTree(childContext);
origin: gocd/gocd

EnvironmentVariablesConfig variables = mock(EnvironmentVariablesConfig.class);
when(tasks.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(true);
when(resourceConfigs.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(true);
when(properties.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(true);
when(artifactConfigs.validateTree(any(PipelineConfigSaveValidationContext.class))).thenReturn(true);
PipelineConfigSaveValidationContext childContext = captor.getValue();
assertThat(childContext.getParent(), is(jobConfig));
verify(resourceConfigs).validateTree(childContext);
verify(properties).validateTree(childContext);
verify(artifactConfigs).validateTree(childContext);
origin: gocd/gocd

  @Test
  public void shouldValidateTree(){
    ResourceConfig resourceConfig1 = new ResourceConfig("a#");
    ResourceConfig resourceConfig2 = new ResourceConfig("b");
    ResourceConfigs resourceConfigs = new ResourceConfigs(resourceConfig1, resourceConfig2);
    resourceConfigs.validateTree(PipelineConfigSaveValidationContext.forChain(true, "group", new PipelineConfig()));
    assertThat(resourceConfig1.errors().size(), is(1));
    assertThat(resourceConfig1.errors().firstError(), is(String.format("Resource name 'a#' is not valid. Valid names much match '%s'", ResourceConfig.VALID_REGEX)));
    assertThat(resourceConfig2.errors().isEmpty(), is(true));
  }
}
com.thoughtworks.go.configResourceConfigsvalidateTree

Popular methods of ResourceConfigs

  • <init>
  • add
  • resourceNames
  • importFromCsv
  • clear
  • contains
  • stream
  • compareTo
  • containsAll
  • equals
  • errors
  • exportToCsv
  • errors,
  • exportToCsv,
  • hashCode,
  • isEmpty,
  • iterator,
  • join,
  • remove,
  • size,
  • toString

Popular in Java

  • Making http requests using okhttp
  • putExtra (Intent)
  • scheduleAtFixedRate (Timer)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Set (java.util)
    A Set is a data structure which does not allow duplicate elements.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • ImageIO (javax.imageio)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now