ChefCookbookAnalyzer { public static CookbookParseResult compile(CharStream input, CookbookParseResult cookbookConfigs) { CookbookParseResult extractedCookbookConfigs; ChefDSLLexer chefDSLLexer = new ChefDSLLexer(input); CommonTokenStream commonTokenStream = new CommonTokenStream(chefDSLLexer); ChefDSLParser chefDSLParser = new ChefDSLParser(commonTokenStream); CookbookVisitor cookbookVisitor = new CookbookVisitor(cookbookConfigs); extractedCookbookConfigs = cookbookVisitor.visit(chefDSLParser.program()); return extractedCookbookConfigs; }  void main(); CookbookParseResult compileCookbook(CookbookParseResult cookbookParseResult, boolean saveToToscaRepo); static CookbookParseResult compile(CharStream input, CookbookParseResult cookbookConfigs); static CookbookParseResult getParseResultFromFile(CookbookParseResult cookbookConfigs, String rbFilePath);  }
@Test public void testCompileMetadata() { List<ChefCookbookConfiguration> cookbookConfigs; CookbookParseResult extractedCookbookConfigs = new CookbookParseResult("openssh"); extractedCookbookConfigs = ChefCookbookAnalyzer.compile(metadata, extractedCookbookConfigs); cookbookConfigs = extractedCookbookConfigs.getAllConfigsAsList(); assertEquals(4, cookbookConfigs.size()); for (int count = 0; count < cookbookConfigs.size(); count++) { assertEquals("openssh", cookbookConfigs.get(count).getName()); assertEquals("Installs and configures OpenSSH client and daemon", cookbookConfigs.get(count).getDescription()); assertTrue(cookbookConfigs.get(count).getDepends().containsKey("iptables")); } assertTrue(extractedCookbookConfigs.getCookbookConfigs().containsKey("aix")); }