private GroovyDocTool makeHtmltool(ArrayList<LinkArgument> links, Properties props) { return new GroovyDocTool( new FileSystemResourceManager("src/main/resources"), // template storage new String[] {"src/test/groovy", "../../src/test"}, // source file dirs GroovyDocTemplateInfo.DEFAULT_DOC_TEMPLATES, GroovyDocTemplateInfo.DEFAULT_PACKAGE_TEMPLATES, GroovyDocTemplateInfo.DEFAULT_CLASS_TEMPLATES, links, props ); }
public void testFileEncodingFallbackToCharset() throws Exception { String expectedCharset = "ISO-88591"; Properties props = new Properties(); props.setProperty("charset", expectedCharset); GroovyDocTool tool = new GroovyDocTool( new FileSystemResourceManager("src"), new String[0], new String[0], new String[0], new String[0], new ArrayList<LinkArgument>(), props); assertEquals("'fileEncoding' falls back to 'charset' if not provided", expectedCharset, tool.properties.getProperty("fileEncoding")); }
public void testCharsetFallbackToFileEncoding() throws Exception { String expectedCharset = "ISO-88591"; Properties props = new Properties(); props.setProperty("fileEncoding", expectedCharset); GroovyDocTool tool = new GroovyDocTool( new FileSystemResourceManager("src"), new String[0], new String[0], new String[0], new String[0], new ArrayList<LinkArgument>(), props); assertEquals("'charset' falls back to 'fileEncoding' if not provided", expectedCharset, tool.properties.getProperty("charset")); }
public void testFileEncodingCharsetFallbackToDefaultCharset() throws Exception { String expectedCharset = Charset.defaultCharset().name(); GroovyDocTool tool = new GroovyDocTool( new FileSystemResourceManager("src"), new String[0], new String[0], new String[0], new String[0], new ArrayList<LinkArgument>(), new Properties()); assertEquals("'charset' falls back to the default charset", expectedCharset, tool.properties.getProperty("charset")); assertEquals("'fileEncoding' falls back to the default charset", expectedCharset, tool.properties.getProperty("fileEncoding")); }
public void setUp() { plainTool = new GroovyDocTool(new String[]{"src/test/groovy"}); xmlTool = new GroovyDocTool( new FileSystemResourceManager("src"), // template storage new String[] {"src/main/java", "../../src/main", "src/test/groovy"}, // source file dirs new String[]{TEMPLATES_DIR + "/topLevel/rootDocStructuredData.xml"}, new String[]{TEMPLATES_DIR + "/packageLevel/packageDocStructuredData.xml"}, new String[]{TEMPLATES_DIR + "/classLevel/classDocStructuredData.xml"}, new ArrayList<LinkArgument>(), new Properties() ); xmlToolForTests = new GroovyDocTool( new FileSystemResourceManager("src"), // template storage new String[] {"src/test/groovy", "src/test/resources", "../../src/test"}, // source file dirs new String[]{TEMPLATES_DIR + "/topLevel/rootDocStructuredData.xml"}, new String[]{TEMPLATES_DIR + "/packageLevel/packageDocStructuredData.xml"}, new String[]{TEMPLATES_DIR + "/classLevel/classDocStructuredData.xml"}, new ArrayList<LinkArgument>(), new Properties() ); ArrayList<LinkArgument> links = new ArrayList<LinkArgument>(); LinkArgument link = new LinkArgument(); link.setHref("http://docs.oracle.com/javase/7/docs/api/"); link.setPackages("java.,org.xml.,javax.,org.xml."); links.add(link); htmlTool = makeHtmltool(links, new Properties()); }