org.apache.maven.doxia.xsd
Class AbstractXmlValidatorTest

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.xsd.AbstractXmlValidatorTest
All Implemented Interfaces:
junit.framework.Test
Direct Known Subclasses:
FmlValidatorTest, XdocValidatorTest

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

Abstract class to validate XML files with Doxia namespaces.

Since:
1.0
Version:
$Id: AbstractXmlValidatorTest.java 747735 2009-02-25 10:43:09Z ltheussl $
Author:
Vincent Siveton

Field Summary
protected static String EOL
          The vm line separator
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
container, context
 
Constructor Summary
AbstractXmlValidatorTest()
           
 
Method Summary
protected abstract  String addNamespaces(String content)
           
protected static Map getAllTestDocuments()
          Find test resources in the doxia-test-docs-XXX.jar
protected abstract  String[] getIncludes()
           
protected  Map getTestDocuments()
           
protected  void setUp()
          
protected  void tearDown()
          
 void testXmlFilesWithDoxiaNamespaces()
          Test xml files with namespace.
 
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
 
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
 

Field Detail

EOL

protected static final String EOL
The vm line separator

Constructor Detail

AbstractXmlValidatorTest

public AbstractXmlValidatorTest()
Method Detail

setUp

protected void setUp()
              throws Exception

Overrides:
setUp in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception

tearDown

protected void tearDown()
                 throws Exception

Overrides:
tearDown in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception

getIncludes

protected abstract String[] getIncludes()
Returns:
a non null patterns to includes specific test files.
See Also:
getTestDocuments()

addNamespaces

protected abstract String addNamespaces(String content)
Parameters:
content - xml content not null
Returns:
xml content with the wanted Doxia namespace

testXmlFilesWithDoxiaNamespaces

public void testXmlFilesWithDoxiaNamespaces()
                                     throws Exception
Test xml files with namespace.

Throws:
Exception - if any

getTestDocuments

protected Map getTestDocuments()
                        throws IOException
Returns:
a map of test resources filtered by patterns from getIncludes().
Throws:
IOException - if any
See Also:
getIncludes(), getAllTestDocuments()

getAllTestDocuments

protected static Map getAllTestDocuments()
                                  throws IOException
Find test resources in the doxia-test-docs-XXX.jar

Returns:
a map of test resources defined as follow:
  • key, the full url of test documents, i.e. jar:file:/.../doxia-test-docs-XXX.jar!/path/to/resource
  • value, the content for the resource defined by the key
Throws:
IOException - if any


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