use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method moduleA.
private void moduleA(boolean includeNonShared) throws Exception {
String pathname = "test/ceylondoc";
String docname = "test/ceylondoc-doc";
String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.single";
CeylonDocTool tool = tool(pathname, docname, moduleName, true, false);
tool.setIncludeNonShared(includeNonShared);
tool.setIncludeSourceCode(true);
tool.setHeader("<div class='navbar-inverse navbar-static-top'>" + "<div class='navbar-inner' style='color:white; font-style: italic; text-align: center'>" + "documentation under construction" + "</div>" + "</div>");
tool.setFooter("<p style='text-align: right;'>" + "Copyright © 2010-2013, Red Hat, Inc. or third-party contributors" + "</p>");
tool.run();
Module module = new Module();
module.setName(Arrays.asList(moduleName));
module.setVersion("3.1.4");
File destDir = getOutputDir(tool, module);
assertFileExists(destDir, includeNonShared);
assertBasicContent(destDir, includeNonShared);
assertConstructors(destDir, includeNonShared);
assertBy(destDir);
assertLicense(destDir);
assertParametersDocumentation(destDir);
assertParametersAssertions(destDir);
assertParametersLinks(destDir);
assertThrows(destDir);
assertSee(destDir);
assertIcons(destDir);
assertInnerTypesDoc(destDir);
assertDeprecated(destDir);
assertTagged(destDir);
assertDocumentationOfRefinedMember(destDir);
assertSequencedParameter(destDir);
assertCallableParameter(destDir);
assertTupleParameter(destDir);
assertDefaultedParametres(destDir);
assertAnythingReturnType(destDir);
assertFencedCodeBlockWithSyntaxHighlighter(destDir);
assertWikiStyleLinkSyntax(destDir, includeNonShared);
assertConstants(destDir);
assertLinksToRefinedDeclaration(destDir);
assertGenericTypeParams(destDir);
assertObjectPageDifferences(destDir);
assertSharedParameterOfClass(destDir);
assertAliases(destDir);
assertPackageNavigation(destDir);
assertSubpackages(destDir);
assertAnnotations(destDir);
assertAbstractClassModifier(destDir);
assertFinalClassModifier(destDir);
assertHeaderAndFooter(destDir);
assertExceptions(destDir);
assertNameAliases(destDir);
assertBug659ShowInheritedMembers(destDir);
assertBug691AbbreviatedOptionalType(destDir);
assertBug839(destDir);
assertBug927LoadingAndSortingInheritedMembers(destDir);
assertBug968(destDir);
assertBug1619BrokenLinkFromInheritedDoc(destDir);
assertBug1619BrokenLinkWithNewLine(destDir);
assertBug2307AliasedName(destDir);
}
use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method documentPackage.
@Test
public void documentPackage() throws Exception {
String pathname = "test/ceylondoc";
String moduleName = "com.redhat.ceylon.ceylondoc.test.modules.multi.a.sub";
try {
CeylonDocTool tool = tool(pathname, moduleName, true, "build/ceylon-cars");
tool.run();
} catch (RuntimeException x) {
Assert.assertEquals("Can't find module: com.redhat.ceylon.ceylondoc.test.modules.multi.a.sub", x.getMessage());
return;
}
Assert.fail("Expected exception");
}
use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method externalLinks.
private File externalLinks(String repoUrl, String... linkArgs) throws Exception {
compile("test/ceylondoc", "com.redhat.ceylon.ceylondoc.test.modules.dependency.b");
compile("test/ceylondoc", "com.redhat.ceylon.ceylondoc.test.modules.dependency.c");
List<String> modules = new ArrayList<String>();
modules.add("com.redhat.ceylon.ceylondoc.test.modules.dependency.b");
modules.add("com.redhat.ceylon.ceylondoc.test.modules.dependency.c");
modules.add("com.redhat.ceylon.ceylondoc.test.modules.externallinks");
CeylonDocTool tool = tool(Arrays.asList(new File("test/ceylondoc")), Collections.<File>emptyList(), modules, true, true, false, "build/ceylon-cars");
tool.setLinks(Arrays.asList(linkArgs));
tool.run();
Module module = new Module();
module.setName(Arrays.asList("com.redhat.ceylon.ceylondoc.test.modules.externallinks"));
module.setVersion("1.0");
File destDir = getOutputDir(tool, module);
assertExternalLinks(destDir, repoUrl);
return destDir;
}
use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method tool.
private CeylonDocTool tool(List<File> sourceFolders, List<File> docFolders, List<String> moduleName, boolean haltOnError, boolean deleteDestDir, boolean bootstrapCeylon, String... repositories) throws Exception {
CeylonDocTool tool = new CeylonDocTool();
tool.setSourceFolders(sourceFolders);
tool.setRepositoryAsStrings(Arrays.asList(repositories));
tool.setModuleSpecs(moduleName);
tool.setDocFolders(docFolders);
tool.setHaltOnError(haltOnError);
tool.setBootstrapCeylon(bootstrapCeylon);
File dir = new File("build", "CeylonDocToolTest/" + name.getMethodName());
if (deleteDestDir && dir.exists()) {
FileUtil.delete(dir);
}
tool.setOut(dir.getAbsolutePath());
tool.initialize(new CeylonTool());
return tool;
}
use of com.redhat.ceylon.ceylondoc.CeylonDocTool in project ceylon-compiler by ceylon.
the class CeylonDocToolTests method dependentOnBinaryModule.
@Test
public void dependentOnBinaryModule() throws Exception {
String pathname = "test/ceylondoc";
// compile the b module
compile(pathname, "com.redhat.ceylon.ceylondoc.test.modules.dependency.b");
CeylonDocTool tool = tool(pathname, "com.redhat.ceylon.ceylondoc.test.modules.dependency.c", true, "build/ceylon-cars");
tool.run();
}
Aggregations