org.apache.maven.doxia.module.latex
Class LatexSinkTest

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by org.codehaus.plexus.PlexusTestCase
              extended by org.apache.maven.doxia.AbstractModuleTest
                  extended by org.apache.maven.doxia.sink.AbstractSinkTest
                      extended by org.apache.maven.doxia.module.latex.LatexSinkTest
All Implemented Interfaces:
junit.framework.Test, Markup

public class LatexSinkTest
extends AbstractSinkTest

Version:
$Id: LatexSinkTest.java 707983 2008-10-26 12:37:49Z vsiveton $
Author:
Jason van Zyl

Field Summary
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
container, context
 
Fields inherited from interface org.apache.maven.doxia.markup.Markup
COLON, EOL, EQUAL, GREATER_THAN, LEFT_CURLY_BRACKET, LEFT_SQUARE_BRACKET, LESS_THAN, MINUS, PLUS, QUOTE, RIGHT_CURLY_BRACKET, RIGHT_SQUARE_BRACKET, SEMICOLON, SLASH, SPACE, STAR
 
Constructor Summary
LatexSinkTest()
           
 
Method Summary
protected  Sink createSink(Writer writer)
          Return a new instance of the sink that is being tested.
protected  String getAnchorBlock(String anchor)
          Returns a Anchor block generated by this sink.
protected  String getAuthorBlock(String author)
          Returns an author block generated by this sink.
protected  String getBodyBlock()
          Returns a body block generated by this sink.
protected  String getBoldBlock(String text)
          Returns a Bold block generated by this sink.
protected  String getDateBlock(String date)
          Returns a date block generated by this sink.
protected  String getDefinitionListBlock(String definum, String definition)
          Returns a DefinitionList block generated by this sink.
protected  String getFigureBlock(String source, String caption)
          Returns a Figure block generated by this sink.
protected  String getHeadBlock()
          Returns a head block generated by this sink.
protected  String getHorizontalRuleBlock()
          Returns a HorizontalRule block generated by this sink.
protected  String getItalicBlock(String text)
          Returns a Italic block generated by this sink.
protected  String getLineBreakBlock()
          Returns a LineBreak block generated by this sink.
protected  String getLinkBlock(String link, String text)
          Returns a Link block generated by this sink.
protected  String getListBlock(String item)
          Returns a list block generated by this sink.
protected  String getMonospacedBlock(String text)
          Returns a Monospaced block generated by this sink.
protected  String getNonBreakingSpaceBlock()
          Returns a NonBreakingSpace block generated by this sink.
protected  String getNumberedListBlock(String item)
          Returns a NumberedList block generated by this sink.
protected  String getPageBreakBlock()
          Returns a PageBreak block generated by this sink.
protected  String getParagraphBlock(String text)
          Returns a Paragraph block generated by this sink.
protected  String getRawTextBlock(String text)
          Returns a RawText block generated by this sink.
protected  String getSection1Block(String title)
          Returns a Section1 block generated by this sink.
protected  String getSection2Block(String title)
          Returns a Section2 block generated by this sink.
protected  String getSection3Block(String title)
          Returns a Section3 block generated by this sink.
protected  String getSection4Block(String title)
          Returns a Section4 block generated by this sink.
protected  String getSection5Block(String title)
          Returns a Section5 block generated by this sink.
protected  String getSectionTitleBlock(String title)
          Returns a SectionTitle block generated by this sink.
protected  String getTableBlock(String cell, String caption)
          Returns a Table block generated by this sink.
protected  String getTextBlock(String text)
          Returns a Text block generated by this sink.
protected  String getTitleBlock(String title)
          Returns a title block generated by this sink.
protected  String getVerbatimBlock(String text)
          Returns a Verbatim block generated by this sink.
protected  boolean isXmlSink()
          This method allows to use the correct Writer in AbstractSinkTest.testTestDocument().
protected  String outputExtension()
          Determines the default file extension for the current module.
 
Methods inherited from class org.apache.maven.doxia.sink.AbstractSinkTest
getOutputDir, getSink, getSinkContent, setUp, testAnchor, testAuthor, testBody, testBold, testDate, testDefinitionList, testFigure, testHead, testHorizontalRule, testItalic, testLineBreak, testLink, testList, testMonospaced, testNonBreakingSpace, testNumberedList, testPageBreak, testParagraph, testRawText, testSection1, testSection2, testSection3, testSection4, testSection5, testSectionTitle, testTable, testTestDocument, testText, testTitle, testVerbatim
 
Methods inherited from class org.apache.maven.doxia.AbstractModuleTest
getBasedirFile, getTestReader, getTestReader, getTestWriter, getTestWriter, getXmlTestWriter, getXmlTestWriter, outputBaseDir
 
Methods inherited from class org.codehaus.plexus.PlexusTestCase
customizeContext, getBasedir, getClassLoader, getConfiguration, getConfiguration, getConfigurationName, getContainer, getCustomConfigurationName, getResourceAsStream, getTestConfiguration, getTestConfiguration, getTestFile, getTestFile, getTestPath, getTestPath, lookup, lookup, lookup, lookup, release, tearDown
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LatexSinkTest

public LatexSinkTest()
Method Detail

outputExtension

protected String outputExtension()
Determines the default file extension for the current module.

Specified by:
outputExtension in class AbstractModuleTest
Returns:
The default file extension.

createSink

protected Sink createSink(Writer writer)
Return a new instance of the sink that is being tested.

Specified by:
createSink in class AbstractSinkTest
Parameters:
writer - The writer for the sink.
Returns:
A new sink.

isXmlSink

protected boolean isXmlSink()
This method allows to use the correct Writer in AbstractSinkTest.testTestDocument().

Specified by:
isXmlSink in class AbstractSinkTest
Returns:
true if the Sink is an XML one, false otherwise.
See Also:
AbstractSinkTest.testTestDocument()

getTitleBlock

protected String getTitleBlock(String title)
Returns a title block generated by this sink.

Specified by:
getTitleBlock in class AbstractSinkTest
Parameters:
title - The title to use.
Returns:
The result of invoking a title block on the current sink.
See Also:
AbstractSinkTest.testTitle()

getAuthorBlock

protected String getAuthorBlock(String author)
Returns an author block generated by this sink.

Specified by:
getAuthorBlock in class AbstractSinkTest
Parameters:
author - The author to use.
Returns:
The result of invoking an author block on the current sink.
See Also:
AbstractSinkTest.testAuthor()

getDateBlock

protected String getDateBlock(String date)
Returns a date block generated by this sink.

Specified by:
getDateBlock in class AbstractSinkTest
Parameters:
date - The date to use.
Returns:
The result of invoking a date block on the current sink.
See Also:
AbstractSinkTest.testDate()

getHeadBlock

protected String getHeadBlock()
Returns a head block generated by this sink.

Specified by:
getHeadBlock in class AbstractSinkTest
Returns:
The result of invoking a head block on the current sink.
See Also:
AbstractSinkTest.testHead()

getBodyBlock

protected String getBodyBlock()
Returns a body block generated by this sink.

Specified by:
getBodyBlock in class AbstractSinkTest
Returns:
The result of invoking a body block on the current sink.
See Also:
AbstractSinkTest.testBody()

getSectionTitleBlock

protected String getSectionTitleBlock(String title)
Returns a SectionTitle block generated by this sink.

Specified by:
getSectionTitleBlock in class AbstractSinkTest
Parameters:
title - The title to use.
Returns:
The result of invoking a SectionTitle block on the current sink.
See Also:
AbstractSinkTest.testSectionTitle()

getSection1Block

protected String getSection1Block(String title)
Returns a Section1 block generated by this sink.

Specified by:
getSection1Block in class AbstractSinkTest
Parameters:
title - The title to use.
Returns:
The result of invoking a Section1 block on the current sink.
See Also:
AbstractSinkTest.testSection1()

getSection2Block

protected String getSection2Block(String title)
Returns a Section2 block generated by this sink.

Specified by:
getSection2Block in class AbstractSinkTest
Parameters:
title - The title to use.
Returns:
The result of invoking a Section2 block on the current sink.
See Also:
AbstractSinkTest.testSection2()

getSection3Block

protected String getSection3Block(String title)
Returns a Section3 block generated by this sink.

Specified by:
getSection3Block in class AbstractSinkTest
Parameters:
title - The title to use.
Returns:
The result of invoking a Section3 block on the current sink.
See Also:
AbstractSinkTest.testSection3()

getSection4Block

protected String getSection4Block(String title)
Returns a Section4 block generated by this sink.

Specified by:
getSection4Block in class AbstractSinkTest
Parameters:
title - The title to use.
Returns:
The result of invoking a Section4 block on the current sink.
See Also:
AbstractSinkTest.testSection4()

getSection5Block

protected String getSection5Block(String title)
Returns a Section5 block generated by this sink.

Specified by:
getSection5Block in class AbstractSinkTest
Parameters:
title - The title to use.
Returns:
The result of invoking a Section5 block on the current sink.
See Also:
AbstractSinkTest.testSection5()

getListBlock

protected String getListBlock(String item)
Returns a list block generated by this sink.

Specified by:
getListBlock in class AbstractSinkTest
Parameters:
item - The item to use.
Returns:
The result of invoking a list block on the current sink.
See Also:
AbstractSinkTest.testList()

getNumberedListBlock

protected String getNumberedListBlock(String item)
Returns a NumberedList block generated by this sink.

Specified by:
getNumberedListBlock in class AbstractSinkTest
Parameters:
item - The item to use.
Returns:
The result of invoking a NumberedList block on the current sink.
See Also:
AbstractSinkTest.testNumberedList()

getDefinitionListBlock

protected String getDefinitionListBlock(String definum,
                                        String definition)
Returns a DefinitionList block generated by this sink.

Specified by:
getDefinitionListBlock in class AbstractSinkTest
Parameters:
definum - The term to define.
definition - The definition.
Returns:
The result of invoking a DefinitionList block on the current sink.
See Also:
AbstractSinkTest.testDefinitionList()

getFigureBlock

protected String getFigureBlock(String source,
                                String caption)
Returns a Figure block generated by this sink.

Specified by:
getFigureBlock in class AbstractSinkTest
Parameters:
source - The figure source string.
caption - The caption to use (may be null).
Returns:
The result of invoking a Figure block on the current sink.
See Also:
AbstractSinkTest.testFigure()

getTableBlock

protected String getTableBlock(String cell,
                               String caption)
Returns a Table block generated by this sink.

Specified by:
getTableBlock in class AbstractSinkTest
Parameters:
cell - A tabel cell to use.
caption - The caption to use (may be null).
Returns:
The result of invoking a Table block on the current sink.
See Also:
AbstractSinkTest.testTable()

getParagraphBlock

protected String getParagraphBlock(String text)
Returns a Paragraph block generated by this sink.

Specified by:
getParagraphBlock in class AbstractSinkTest
Parameters:
text - The text to use.
Returns:
The result of invoking a Paragraph block on the current sink.
See Also:
AbstractSinkTest.testParagraph()

getVerbatimBlock

protected String getVerbatimBlock(String text)
Returns a Verbatim block generated by this sink.

Specified by:
getVerbatimBlock in class AbstractSinkTest
Parameters:
text - The text to use.
Returns:
The result of invoking a Verbatim block on the current sink.
See Also:
AbstractSinkTest.testVerbatim()

getHorizontalRuleBlock

protected String getHorizontalRuleBlock()
Returns a HorizontalRule block generated by this sink.

Specified by:
getHorizontalRuleBlock in class AbstractSinkTest
Returns:
The result of invoking a HorizontalRule block on the current sink.
See Also:
AbstractSinkTest.testHorizontalRule()

getPageBreakBlock

protected String getPageBreakBlock()
Returns a PageBreak block generated by this sink.

Specified by:
getPageBreakBlock in class AbstractSinkTest
Returns:
The result of invoking a PageBreak block on the current sink.
See Also:
AbstractSinkTest.testPageBreak()

getAnchorBlock

protected String getAnchorBlock(String anchor)
Returns a Anchor block generated by this sink.

Specified by:
getAnchorBlock in class AbstractSinkTest
Parameters:
anchor - The anchor to use.
Returns:
The result of invoking a Anchor block on the current sink.
See Also:
AbstractSinkTest.testAnchor()

getLinkBlock

protected String getLinkBlock(String link,
                              String text)
Returns a Link block generated by this sink.

Specified by:
getLinkBlock in class AbstractSinkTest
Parameters:
link - The link to use.
text - The link text.
Returns:
The result of invoking a Link block on the current sink.
See Also:
AbstractSinkTest.testLink()

getItalicBlock

protected String getItalicBlock(String text)
Returns a Italic block generated by this sink.

Specified by:
getItalicBlock in class AbstractSinkTest
Parameters:
text - The text to use.
Returns:
The result of invoking a Italic block on the current sink.
See Also:
AbstractSinkTest.testItalic()

getBoldBlock

protected String getBoldBlock(String text)
Returns a Bold block generated by this sink.

Specified by:
getBoldBlock in class AbstractSinkTest
Parameters:
text - The text to use.
Returns:
The result of invoking a Bold block on the current sink.
See Also:
AbstractSinkTest.testBold()

getMonospacedBlock

protected String getMonospacedBlock(String text)
Returns a Monospaced block generated by this sink.

Specified by:
getMonospacedBlock in class AbstractSinkTest
Parameters:
text - The text to use.
Returns:
The result of invoking a Monospaced block on the current sink.
See Also:
AbstractSinkTest.testMonospaced()

getLineBreakBlock

protected String getLineBreakBlock()
Returns a LineBreak block generated by this sink.

Specified by:
getLineBreakBlock in class AbstractSinkTest
Returns:
The result of invoking a LineBreak block on the current sink.
See Also:
AbstractSinkTest.testLineBreak()

getNonBreakingSpaceBlock

protected String getNonBreakingSpaceBlock()
Returns a NonBreakingSpace block generated by this sink.

Specified by:
getNonBreakingSpaceBlock in class AbstractSinkTest
Returns:
The result of invoking a NonBreakingSpace block on the current sink.
See Also:
AbstractSinkTest.testNonBreakingSpace()

getTextBlock

protected String getTextBlock(String text)
Returns a Text block generated by this sink.

Specified by:
getTextBlock in class AbstractSinkTest
Parameters:
text - The text to use.
Returns:
The result of invoking a Text block on the current sink.
See Also:
AbstractSinkTest.testText()

getRawTextBlock

protected String getRawTextBlock(String text)
Returns a RawText block generated by this sink.

Specified by:
getRawTextBlock in class AbstractSinkTest
Parameters:
text - The text to use.
Returns:
The result of invoking a RawText block on the current sink.
See Also:
AbstractSinkTest.testRawText()


Copyright © 2005-2009 The Apache Software Foundation. All Rights Reserved.