Package com.puppetlabs.geppetto.diagnostic

Examples of com.puppetlabs.geppetto.diagnostic.Diagnostic


   */
  @Test
  public void validateNodes2() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/testRoles2/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    ValidationOptions options = getValidationOptions();
    options.setCheckLayout(true);
    options.setCheckModuleSemantics(true);
    options.setCheckReferences(true);
    options.setFileType(FileType.PUPPET_ROOT);
View Full Code Here


    try {
      File installFolder = getTestOutputFolder("apache-install-here", true);
      File resultFolder = getTestOutputFolder("apache-build-result", true);
      FileUtils.cpR(getTestData("puppetlabs-apache"), installFolder, ModuleUtils.DEFAULT_FILE_FILTER, false, true);
      Metadata[] mdHandle = new Metadata[1];
      fixture.build(installFolder, resultFolder, null, mdHandle, null, new Diagnostic());
      Metadata md = mdHandle[0];
      String archiveName = md.getName().toString() + '-' + md.getVersion();
      File builtArchive = new File(resultFolder, archiveName + ".tar.gz");
      assertTrue("Build did not build any archive", builtArchive.canRead());
      File unpackFolder = getTestOutputFolder("apache-unpack-result", true);
View Full Code Here

  public void changes() {
    try {
      File installFolder = getTestOutputFolder("test-changes", true);
      File resultFolder = getTestOutputFolder("test-changes-result", true);
      FileUtils.cpR(getTestData("puppetlabs-apache"), installFolder, ModuleUtils.DEFAULT_FILE_FILTER, false, true);
      fixture.build(installFolder, resultFolder, null, null, null, new Diagnostic());
      Collection<File> changes = fixture.changes(installFolder, null);
      assertTrue("Unexpected changes", changes.isEmpty());
    }
    catch(IOException e) {
      fail(e.getMessage());
View Full Code Here

  @Test
  public void loadModule() {
    try {
      Metadata md = getForgeUtil().createFromModuleDirectory(
        getTestData("puppetlabs-apache"), false, null, null, new Diagnostic());
      assertEquals("Unexpected module name", ModuleName.fromString("puppetlabs-apache"), md.getName());
    }
    catch(IOException e) {
      fail(e.getMessage());
    }
View Full Code Here

  @Test
  public void loadModule2() {
    try {
      Metadata md = getForgeUtil().createFromModuleDirectory(
        getTestData("DavidSchmitt-collectd"), false, null, null, new Diagnostic());
      assertEquals("Unexpected module name", ModuleName.fromString("davidschmitt-collectd"), md.getName());
    }
    catch(IOException e) {
      fail(e.getMessage());
    }
View Full Code Here

  @Test
  public void loadModule3() {
    try {
      Metadata md = getForgeUtil().createFromModuleDirectory(
        getTestData("bobsh-iptables"), false, null, null, new Diagnostic());
      assertEquals("Unexpected module name", ModuleName.fromString("bobsh/iptables"), md.getName());
    }
    catch(IOException e) {
      fail(e.getMessage());
    }
View Full Code Here

  @Test
  public void loadModule4() {
    try {
      Metadata md = getForgeUtil().createFromModuleDirectory(
        getTestData("ghoneycutt-rsync"), false, null, null, new Diagnostic());
      assertEquals("Unexpected module name", ModuleName.fromString("ghoneycutt-RSync"), md.getName());
    }
    catch(IOException e) {
      fail(e.getMessage());
    }
View Full Code Here

  @Test
  public void loadModule5() {
    try {
      Metadata md = getForgeUtil().createFromModuleDirectory(
        getTestData("lab42-common"), false, null, null, new Diagnostic());
      assertEquals("Unexpected module name", ModuleName.fromString("lab42-common"), md.getName());
    }
    catch(IOException e) {
      fail(e.getMessage());
    }
View Full Code Here

  @Test
  public void parseModuleFile__File() {
    try {
      Metadata md = new Metadata();
      ModuleUtils.parseModulefile(getTestData("puppetlabs-apache/Modulefile"), md, new Diagnostic());
      assertEquals("Unexpected module name", ModuleName.fromString("puppetlabs-apache"), md.getName());
    }
    catch(IOException e) {
      fail(e.getMessage());
    }
View Full Code Here

  @Test
  public void relativeAmbiguityErrorReport() throws Exception {
    File root = TestDataProvider.getTestFile(new Path("testData/ambiguity/"));
    ValidationService vs = getValidationService();
    Diagnostic chain = new Diagnostic();
    ValidationOptions options = getValidationOptions();
    options.setCheckLayout(false);
    options.setCheckModuleSemantics(false);
    options.setCheckReferences(true);
    options.setFileType(FileType.MODULE_ROOT);

    vs.validate(chain, root, options, null, SubMonitor.convert(null));
    assertContainsErrorCode(chain, IPPDiagnostics.ISSUE__RESOURCE_AMBIGUOUS_REFERENCE);
    assertTrue(
      "Message text should contain a relative reference",
      chain.getChildren().get(0).getMessage().startsWith("Ambiguous reference to: 'fluff' found in: 1 resource [") &&
          chain.getChildren().get(0).getMessage().contains("manifests/ambigA.pp"));

  }
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.