Search in sources :

Example 6 with CeylonDocTool

use of org.eclipse.ceylon.ceylondoc.CeylonDocTool in project ceylon by eclipse.

the class CeylonDocToolTests method bug2094.

@Test
public void bug2094() throws Exception {
    String pathname = "test/ceylondoc";
    String moduleName = "org.eclipse.ceylon.ceylondoc.test.modules.bug2094";
    CeylonDocTool tool = tool(Arrays.asList(new File(pathname)), Arrays.asList(new File("doc")), Arrays.asList(moduleName), true, false, false);
    tool.run();
}
Also used : CeylonDocTool(org.eclipse.ceylon.ceylondoc.CeylonDocTool) File(java.io.File) Test(org.junit.Test)

Example 7 with CeylonDocTool

use of org.eclipse.ceylon.ceylondoc.CeylonDocTool in project ceylon by eclipse.

the class CeylonDocToolTests method documentPackage.

@Test
public void documentPackage() throws Exception {
    String pathname = "test/ceylondoc";
    String moduleName = "org.eclipse.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: org.eclipse.ceylon.ceylondoc.test.modules.multi.a.sub", x.getMessage());
        return;
    }
    Assert.fail("Expected exception");
}
Also used : CeylonDocTool(org.eclipse.ceylon.ceylondoc.CeylonDocTool) Test(org.junit.Test)

Example 8 with CeylonDocTool

use of org.eclipse.ceylon.ceylondoc.CeylonDocTool in project ceylon by eclipse.

the class CeylonDocToolTests method bug2285.

@Test
public void bug2285() throws Exception {
    String pathname = "test/ceylondoc-doesnotexist";
    String moduleName = "org.eclipse.ceylon.ceylondoc.test.modules.bug2285";
    Module module = new Module();
    module.setName(Arrays.asList(moduleName));
    module.setVersion("1");
    try {
        CeylonDocTool tool = tool(Arrays.asList(new File(pathname)), Arrays.asList(new File("doc")), Arrays.asList(moduleName), true, false, false);
        tool.run();
        Assert.fail();
    } catch (RuntimeException x) {
        Assert.assertEquals("Can't find module: org.eclipse.ceylon.ceylondoc.test.modules.bug2285", x.getMessage());
    }
}
Also used : CeylonDocTool(org.eclipse.ceylon.ceylondoc.CeylonDocTool) Module(org.eclipse.ceylon.model.typechecker.model.Module) File(java.io.File) Test(org.junit.Test)

Example 9 with CeylonDocTool

use of org.eclipse.ceylon.ceylondoc.CeylonDocTool in project ceylon by eclipse.

the class CeylonDocToolTests method ceylonSdk.

@Test
public void ceylonSdk() throws Exception {
    Assume.assumeTrue(CompilerTests.allowSdkTests());
    File sdkDir = new File("../../ceylon-sdk");
    if (!sdkDir.exists() || !sdkDir.isDirectory()) {
        Assert.fail("You don't have ceylon-sdk checked out at " + sdkDir.getAbsolutePath() + " so this test doesn't apply");
    }
    String[] fullModuleNames = { "ceylon.buffer", "ceylon.collection", "ceylon.dbc", "ceylon.decimal", "ceylon.file", "ceylon.html", "ceylon.http.client", "ceylon.http.common", "ceylon.http.server", "ceylon.interop.browser", "ceylon.interop.java", "ceylon.io", "ceylon.json", "ceylon.locale", "ceylon.logging", "ceylon.math", "ceylon.numeric", "ceylon.process", "ceylon.promise", "ceylon.random", "ceylon.regex", "ceylon.test", "ceylon.time", "ceylon.unicode", "ceylon.uri", "ceylon.whole", "org.eclipse.ceylon.war" };
    compileSdkJavaFiles();
    CeylonDocTool tool = tool(Arrays.asList(new File("../../ceylon-sdk/source")), new String[0], null, Collections.<File>emptyList(), Arrays.asList(fullModuleNames), true, false, false);
    tool.setIncludeNonShared(false);
    tool.setIncludeSourceCode(true);
    tool.run();
    Map<String, String> nameToVersion = new HashMap<String, String>();
    for (Module module : tool.getDocumentedModules()) {
        nameToVersion.put(module.getNameAsString(), module.getVersion());
    }
    for (String moduleName : fullModuleNames) {
        File destDir = getOutputDir(tool, moduleName, nameToVersion.get(moduleName));
        assertFileExists(destDir, "index.html");
    }
}
Also used : CeylonDocTool(org.eclipse.ceylon.ceylondoc.CeylonDocTool) HashMap(java.util.HashMap) Module(org.eclipse.ceylon.model.typechecker.model.Module) File(java.io.File) Test(org.junit.Test)

Example 10 with CeylonDocTool

use of org.eclipse.ceylon.ceylondoc.CeylonDocTool in project ceylon by eclipse.

the class CeylonDocToolTests method containsJavaCode.

@Test
public void containsJavaCode() throws Exception {
    String pathname = "test/ceylondoc";
    String moduleName = "org.eclipse.ceylon.ceylondoc.test.modules.mixed";
    // compile the java code first
    compileJavaModule(pathname, "org/eclipse/ceylon/ceylondoc/test/modules/mixed/Java.java", "org/eclipse/ceylon/ceylondoc/test/modules/mixed/JavaWithCeylonAnnotations.java");
    CeylonDocTool tool = tool(pathname, moduleName, true, "build/ceylon-cars");
    tool.run();
    File destDir = getOutputDir(tool, moduleName, "1.0.0");
    assertOverloadedMethods(destDir);
}
Also used : CeylonDocTool(org.eclipse.ceylon.ceylondoc.CeylonDocTool) File(java.io.File) Test(org.junit.Test)

Aggregations

CeylonDocTool (org.eclipse.ceylon.ceylondoc.CeylonDocTool)23 Test (org.junit.Test)20 File (java.io.File)16 Module (org.eclipse.ceylon.model.typechecker.model.Module)3 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 CeylonTool (org.eclipse.ceylon.common.tools.CeylonTool)1