Package com.puppetlabs.geppetto.validation

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


    options.setCheckLayout(false);
    options.setCheckModuleSemantics(false);
    options.setCheckReferences(false);
    options.setFileType(FileType.MODULE_ROOT);

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

    // Same but using a repository layout
    root = TestDataProvider.getTestFile(new Path("testData/ghbindcases/asrepo/"));
    vs = getValidationService();
View Full Code Here


    options.setCheckLayout(true);
    options.setCheckModuleSemantics(true);
    options.setCheckReferences(true);
    options.setFileType(FileType.PUPPET_ROOT);

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

    // Use API1 call to do the same as repository layout validation above
    vs = getValidationService();
    chain = new Diagnostic();
View Full Code Here

    options.setCheckLayout(false);
    options.setCheckModuleSemantics(false);
    options.setCheckReferences(false);
    options.setFileType(FileType.SINGLE_SOURCE_FILE);

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

    // Validate single file in context of repo
    root = TestDataProvider.getTestFile(new Path("testData/ghbindcases/asrepo/"));
    vs = getValidationService();
View Full Code Here

    options.setCheckLayout(true);
    options.setCheckModuleSemantics(true);
    options.setCheckReferences(true);
    options.setFileType(FileType.PUPPET_ROOT);

    vs.validate(chain, root, options, new File[] { new File(
      root, "modules/ghoneycutt-bind-1.0.0/manifests/master.pp") }, SubMonitor.convert(null));
    assertContainsErrorCode(chain, IPPDiagnostics.ISSUE__MISSING_COMMA);
    DiagnosticsAsserter asserter = new DiagnosticsAsserter(chain);
    asserter.assertErrors(//
      asserter.messageFragment("Unknown class: 'generic'"), //
View Full Code Here

    options.setCheckLayout(true);
    options.setCheckModuleSemantics(true);
    options.setCheckReferences(true);
    options.setFileType(FileType.PUPPET_ROOT);
    options.setPlatformURI(PuppetTarget.PUPPET26.getPlatformURI());
    vs.validate(chain, root, options, null, SubMonitor.convert(null));

    assertEquals("There should be 1 errors", 1, chain.getChildren().size());

    chain = new Diagnostic();
    options.setPlatformURI(PuppetTarget.PUPPET27.getPlatformURI());
View Full Code Here

    assertEquals("There should be 1 errors", 1, chain.getChildren().size());

    chain = new Diagnostic();
    options.setPlatformURI(PuppetTarget.PUPPET27.getPlatformURI());
    vs.validate(chain, root, options, null, SubMonitor.convert(null));
    dumpErrors(chain);
    assertEquals("There should be 0 errors", 0, chain.getChildren().size());

  }
View Full Code Here

    // Write the dot to a file:
    File outputFolder = TestDataProvider.getTestOutputDir();
    FileOutputStream dotStream = new FileOutputStream(new File(outputFolder, "demoGraphSVG.dot"));

    BuildResult buildResult = vs.validate(chain, root, options, null, SubMonitor.convert(null));
    assertTrue("Validation had errors", chain.getSeverity() < Diagnostic.ERROR);
    getDependencyGraphProducer().produceGraph(
      null, "Demo DefaultModules Dependencies", null, dotStream, buildResult, chain);

    // produce SVG
View Full Code Here

    options.setCheckReferences(true);
    options.setFileType(FileType.PUPPET_ROOT);
    ByteArrayOutputStream stream = new ByteArrayOutputStream();

    ValidationService vs = getValidationService();
    BuildResult result = vs.validate(chain, root, options, null, SubMonitor.convert(null));
    getDependencyGraphProducer().produceGraph(
      null, "Module dependencies for graphTestData", null, stream, result, chain);

    assertTrue("Stream contains data", stream.size() > 10);
    String output = stream.toString();
View Full Code Here

    options.setCheckLayout(true);
    options.setCheckModuleSemantics(true);
    options.setCheckReferences(true);
    options.setFileType(FileType.PUPPET_ROOT);
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    BuildResult result = vs.validate(chain, root, options, null, SubMonitor.convert(null));
    getDependencyGraphProducer().produceGraph(
      null, "Module dependencies for graphDataIncludeRequire/include", null, stream, result, chain);

    //    dumpImports(result.getAllModuleReferences());
View Full Code Here

    options.setCheckModuleSemantics(true);
    options.setCheckReferences(true);
    options.setFileType(FileType.PUPPET_ROOT);
    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    File[] modules = new File[] { new File(root, "modules/B/Modulefile") };
    BuildResult buildResult = vs.validate(chain, root, options, null, SubMonitor.convert(null));
    // dumpExports(buildResult.getExportsForAll());
    getDependencyGraphProducer().produceGraph(
      null, "Module dependencies for graphTestData", modules, stream, buildResult, chain);

    String output = stream.toString();
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.