Package com.puppetlabs.geppetto.validation

Examples of com.puppetlabs.geppetto.validation.ValidationService.validate()


      ValidationOptions options = getValidationOptions();
      options.setCheckLayout(true);
      options.setCheckModuleSemantics(true);
      options.setCheckReferences(true);
      options.setFileType(FileType.PUPPET_ROOT);
      BuildResult br = vs.validate(chain, root, options, null, SubMonitor.convert(null));

      // System.err.println(errorsToString(chain));
      StringBuilder builder = new StringBuilder();
      builder.append("Diagnostic: A version should be specified.\n");
      builder.append("Diagnostic: A version should be specified.\n");
View Full Code Here


      ValidationOptions options = getValidationOptions();
      options.setCheckLayout(true);
      options.setCheckModuleSemantics(true);
      options.setCheckReferences(true);
      options.setFileType(FileType.PUPPET_ROOT);
      BuildResult br = vs.validate(chain, root, options, new File[] { new File(
        "/Users/henrik/gitrepos/stackhammer-demo/nodes/foo/") }, SubMonitor.convert(null));

      // System.err.println(errorsToString(chain));
      StringBuilder builder = new StringBuilder();
      builder.append("Diagnostic: A version should be specified.\n");
View Full Code Here

      ValidationOptions options = getValidationOptions();
      options.setCheckLayout(true);
      options.setCheckModuleSemantics(true);
      options.setCheckReferences(true);
      options.setFileType(FileType.PUPPET_ROOT);
      BuildResult br = vs.validate(chain, root, options, null, SubMonitor.convert(null));

      // System.err.println(errorsToString(chain));
      // StringBuilder builder = new StringBuilder();

      assertEquals("There should be the expected errors", "", errorsToString(chain));
View Full Code Here

    ValidationOptions options = getValidationOptions();
    options.setCheckLayout(true);
    options.setCheckModuleSemantics(true);
    options.setCheckReferences(true);
    options.setFileType(FileType.PUPPET_ROOT);
    vs.validate(chain, root, options, null, SubMonitor.convert(null));
    assertEquals("There should be 0 errors", 0, chain.getChildren().size());
  }
}
View Full Code Here

    File theRakefile = new File(root, "a/Rakefile");
    assertTrue("CONFIGURATION ERROR: Testdata a/Rakefile must exist: check test config!", theRakefile.exists());

    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    BuildResult result = vs.validate(chain, root, null, null, SubMonitor.convert(null));
    assertTrue(
      "CONFIGURATION ERROR:: Configuration should include ruby services!!", result.isRubyServicesAvailable());
  }

  @Test
View Full Code Here

  @Test
  public void oneRakefile4Tasks() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/rakefiledata/simple/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    BuildResult result = vs.validate(chain, root, null, null, SubMonitor.convert(null));
    DiagnosticsAsserter asserter = new DiagnosticsAsserter(chain);
    asserter.assertAll(asserter.issue(IPPDiagnostics.ISSUE__STRING_BOOLEAN).optional().greedy());

    RakefileInfo rakefileInfo = result.getRakefileInfo();
    assertEquals("Should have found a rakefile", 1, rakefileInfo.getRakefiles().size());
View Full Code Here

  @Test
  public void oneRakefileWithCode() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/rakefiledata/withcode/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    BuildResult result = vs.validate(chain, root, null, null, SubMonitor.convert(null));
    DiagnosticsAsserter asserter = new DiagnosticsAsserter(chain);
    asserter.assertAll(asserter.issue(IPPDiagnostics.ISSUE__STRING_BOOLEAN).optional().greedy());

    RakefileInfo rakefileInfo = result.getRakefileInfo();
    assertEquals("Should have found a rakefile", 1, rakefileInfo.getRakefiles().size());
View Full Code Here

  @Test
  public void rakefileFromJenkinsModule() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/rakefiledata/fromJenkinsModule/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    BuildResult result = vs.validate(chain, root, null, null, SubMonitor.convert(null));
    DiagnosticsAsserter asserter = new DiagnosticsAsserter(chain);
    asserter.assertAll(asserter.issue(IPPDiagnostics.ISSUE__STRING_BOOLEAN).optional().greedy());

    RakefileInfo rakefileInfo = result.getRakefileInfo();
    assertEquals("Should have found one rakefile", 1, rakefileInfo.getRakefiles().size());
View Full Code Here

  @Test
  public void twoRakefilesWith4Tasks() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/rakefiledata/twice/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    BuildResult result = vs.validate(chain, root, null, null, SubMonitor.convert(null));
    DiagnosticsAsserter asserter = new DiagnosticsAsserter(chain);
    asserter.assertAll(asserter.issue(IPPDiagnostics.ISSUE__STRING_BOOLEAN).optional().greedy());

    RakefileInfo rakefileInfo = result.getRakefileInfo();
    assertEquals("Should have found two rakefiles", 2, rakefileInfo.getRakefiles().size());
View Full Code Here

    options.setCheckModuleSemantics(true);
    options.setCheckReferences(false);
    options.setFileType(FileType.PUPPET_ROOT);
    options.setProblemsAdvisor(new DefaultPotentialProblemsAdvisor());

    vs.validate(chain, root, options, null, SubMonitor.convert(null));

    int circularity = 0;
    int otherErrors = 0;

    for(Diagnostic e : chain)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.