@Test public void createBuilder() { markupToEclipseHelp.copyrightNotice = UUID.randomUUID().toString(); markupToEclipseHelp.title = UUID.randomUUID().toString(); markupToEclipseHelp.htmlFilenameFormat = "$1.test.html"; HtmlDocumentBuilder builder = markupToEclipseHelp.createRootBuilder(new StringWriter(), "test", ""); assertEquals(markupToEclipseHelp.copyrightNotice, builder.getCopyrightNotice()); assertEquals(markupToEclipseHelp.title, builder.getTitle()); assertEquals(markupToEclipseHelp.htmlFilenameFormat, builder.getHtmlFilenameFormat()); }
@Test public void execute() throws MojoExecutionException, MojoFailureException { markupToEclipseHelp.multipleOutputFiles = true; markupToEclipseHelp.title = "Test This"; markupToEclipseHelp.execute(); assertTrue(computeOutputFile("test.html").exists()); assertTrue(computeOutputFile("test-toc.xml").exists()); assertTrue(computeOutputFile("Top-Level-Heading-2.html").exists()); assertTrue(computeOutputFile("Top-Level-Heading-3.html").exists()); assertTrue(computeOutputFile("images/wikitext-32.gif").exists()); assertFalse(computeOutputFile("test.textile").exists()); assertHasContent("test.html", "<title>Test This</title>"); assertHasContent("test.html", "<h1 id=\"TestFile\">Test File</h1>"); assertHasContent("test-toc.xml", "<toc topic=\"test.html\" label=\"Test This\">"); assertHasContent( "test-toc.xml", "<topic href=\"Top-Level-Heading-2.html\" label=\"Top Level Heading 2\">"); assertHasContent( "Top-Level-Heading-2.html", "<h1 id=\"TopLevelHeading2\">Top Level Heading 2</h1>"); assertHasContent( "Top-Level-Heading-3.html", "<h1 id=\"TopLevelHeading3\">Top Level Heading 3</h1>"); }