Package com.puppetlabs.geppetto.forge.model

Examples of com.puppetlabs.geppetto.forge.model.Metadata


  }

  @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

  private void performJsonSerialization(String module) {
    populateFromModule(module);
    Gson gson = getGson();
    String json1 = gson.toJson(fixture);
    Metadata mi = gson.fromJson(json1, Metadata.class);
    assertMetadataEquals(mi);
  }
View Full Code Here

      populateFromModule("ghoneycutt-rsync");
      File moduleFile = new File(outputDir, MODULEFILE_NAME);
      ModuleUtils.saveAsModulefile(fixture, moduleFile);
      assertTrue("No readable Modulefile file was generated", moduleFile.canRead());

      Metadata tst = new Metadata();
      ModuleUtils.parseModulefile(moduleFile, tst, new Diagnostic());
      assertEquals("Expected 2 dependencies", 2, tst.getDependencies().size());
      assertEquals("Expected 3 lines of text", 3, countLines(tst.getDescription()));
      assertEquals("Expected 4 lines of text", 4, countLines(tst.getSummary()));
      assertEquals("Expected 5 lines of text", 5, countLines(tst.getLicense()));
    }
    catch(IOException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

TOP

Related Classes of com.puppetlabs.geppetto.forge.model.Metadata

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.