org.apache.maven.doxia.sink
Class AbstractSinkTestCase

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.sink.AbstractSinkTestCase
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
RtfSinkTest

public abstract class AbstractSinkTestCase
extends org.codehaus.plexus.PlexusTestCase

Since:
1.0
Version:
$Id: AbstractSinkTestCase.java 747735 2009-02-25 10:43:09Z ltheussl $
Author:
Jason van Zyl

Field Summary
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
container, context
 
Constructor Summary
AbstractSinkTestCase()
           
 
Method Summary
protected abstract  Parser createParser()
          Return a Parser for testing.
protected abstract  Sink createSink()
          Return a Sink for testing.
 File getBasedirFile()
          Return the current base diretory as a File.
protected  Reader getTestReader()
          Returns a Reader that gives access to a common test apt file.
protected  Writer getTestWriter()
          Returns a Writer to write a test output result.
protected abstract  String outputExtension()
          Return the default extension of files created by the test Sink.
 void testApt()
          Parses the test apt document (obtained via getTestReader()) with the Parser returned by createParser() into the Sink returned by createSink().
 
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, setUp, 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

AbstractSinkTestCase

public AbstractSinkTestCase()
Method Detail

testApt

public void testApt()
             throws Exception
Parses the test apt document (obtained via getTestReader()) with the Parser returned by createParser() into the Sink returned by createSink().

Throws:
Exception - if anything goes wrong.

outputExtension

protected abstract String outputExtension()
Return the default extension of files created by the test Sink.

Returns:
the extension of files created by the test Sink.
See Also:
createSink()

createParser

protected abstract Parser createParser()
Return a Parser for testing.

Returns:
a test Parser.

createSink

protected abstract Sink createSink()
                            throws Exception
Return a Sink for testing.

Returns:
a test Sink.
Throws:
Exception - if the Sink cannot be constructed.

getTestWriter

protected Writer getTestWriter()
                        throws Exception
Returns a Writer to write a test output result. The Writer writes to a File "target/output/test. + extension", where extension is returned by outputExtension(), in the current base directory.

Returns:
a Writer to write a test output result.
Throws:
Exception - if the Writer cannot be constructed.

getTestReader

protected Reader getTestReader()
                        throws Exception
Returns a Reader that gives access to a common test apt file.

Returns:
a Reader to access the test apt resource file.
Throws:
Exception - if the Reader cannot be constructed.

getBasedirFile

public File getBasedirFile()
Return the current base diretory as a File.

Returns:
the current base diretory as a File.


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