Package com.puppetlabs.geppetto.diagnostic

Examples of com.puppetlabs.geppetto.diagnostic.Diagnostic


          protected ForgeService getForgeService() {
            return injector.getInstance(ForgeService.class);
          }
        };
        boolean result = executeExport(exportOp);
        Diagnostic diag = exportOp.getDiagnostic();
        if(diag.getSeverity() == Diagnostic.ERROR) {
          Exception e = diag.getException();
          ErrorDialog.openError(
            getContainer().getShell(), DataTransferMessages.DataTransfer_exportProblems, null, // no special message
            UIPlugin.createStatus(IStatus.ERROR, diag.toString(), e));
        }
        else
          MessageDialog.openInformation(
            getContainer().getShell(), DataTransferMessages.DataTransfer_information, diag.toString());
        return result;
      }
      catch(CoreException e) {
        ErrorDialog.openError(
          getContainer().getShell(), DataTransferMessages.DataTransfer_exportProblems, null, // no special message
View Full Code Here


      try {
        @SuppressWarnings("unchecked")
        List<IResource> whiteCheckedResources = getWhiteCheckedResources();
        UIPlugin plugin = UIPlugin.getInstance();
        String owner = null;
        Diagnostic diag = new Diagnostic();
        for(ExportSpec spec : getExportSpecs(whiteCheckedResources)) {
          try {
            Metadata md = getForge().createFromModuleDirectory(
              spec.getModuleRoot(), false, spec.getFileFilter(), null, diag);
            if(md != null) {
View Full Code Here

      File moduleFile = new File(projectDir, MODULEFILE_NAME);
      boolean moduleFileExists = moduleFile.exists();
      if(moduleFileExists) {
        // Check if this file is viable.
        boolean renameModuleFile = false;
        Diagnostic chain = new Diagnostic();
        Metadata receiver = new Metadata();
        try {
          ModuleUtils.parseModulefile(moduleFile, receiver, chain);
          for(Diagnostic problem : chain)
            if(problem.getSeverity() >= Diagnostic.ERROR) {
View Full Code Here

  @Test
  public void validateAString_NotOk() throws Exception {
    String code = "$a = ";
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    vs.validateManifest(chain, code, null);
    assertTrue("There should be errors", chain.getChildren().size() != 0);
  }
View Full Code Here

  @Test
  public void validateAString_ok() throws Exception {
    String code = "$a = 'a::b'";
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    vs.validateManifest(chain, code, SubMonitor.convert(null));
    assertTrue("There should be no errors", chain.getChildren().size() == 0);
  }
View Full Code Here

  @Test
  public void validateCiruclarRepositories() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/circularModules/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();

    // Set options like API1 would behave for a validateRepository
    ValidationOptions options = getValidationOptions();
    options.setCheckLayout(true);
    options.setCheckModuleSemantics(true);
View Full Code Here

  @Test
  public void validateManifest_notok() throws Exception {
    File manifest = TestDataProvider.getTestFile(new Path("testData/manifests/not_ok_manifest.pp"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    vs.validateManifest(chain, manifest, SubMonitor.convert(null));
    assertTrue("There should be errors", countErrors(chain) > 0);
  }
View Full Code Here

  @Test
  public void validateManifest_ok() throws Exception {
    File manifest = TestDataProvider.getTestFile(new Path("testData/manifests/ok_manifest.pp"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    vs.validateManifest(chain, manifest, SubMonitor.convert(null));
    assertTrue("There should be no errors", countErrors(chain) == 0);
  }
View Full Code Here

  @Test
  public void validateModule_notok() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/broken/broken-module/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    vs.validateRepository(chain, root, SubMonitor.convert(null));
    DiagnosticsAsserter asserter = new DiagnosticsAsserter(chain);
    asserter.assertErrors(asserter.issue("jruby.syntax.error"));
    // optionally accept Unknown variables, and hyphen in name, but no other warnings
    asserter.assertWarnings(
View Full Code Here

  @Test
  public void validateModule_ok() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/test-modules/test-module/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    vs.validateRepository(chain, root, SubMonitor.convert(null));
    DiagnosticsAsserter asserter = new DiagnosticsAsserter(chain);
    // no errors
    asserter.assertErrors();
    // optionally accept Unknown variables, and hyphen in name, but no other warnings
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.diagnostic.Diagnostic

Copyright © 2018 www.massapicom. 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.