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.AbstractXmlValidator
                  extended by org.apache.maven.doxia.xsd.AbstractXmlValidatorTest
All Implemented Interfaces:
junit.framework.Test

public abstract class AbstractXmlValidatorTest
extends AbstractXmlValidator

Abstract class to validate XML files with DTD or XSD mainly for Doxia namespaces.

Since:
1.0
Version:
$Id: AbstractXmlValidatorTest.java 1172204 2011-09-18 06:46:17Z hboutemy $
Author:
Vincent Siveton

Field Summary
 
Fields inherited from class org.apache.maven.doxia.xsd.AbstractXmlValidator
EOL
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
container, context
 
Constructor Summary
AbstractXmlValidatorTest()
           
 
Method Summary
protected static Map<String,String> getAllTestDocuments()
          Find test resources in the doxia-test-docs-XXX.jar or in an IDE project.
protected  EntityResolver getEntityResolver()
          Returns the EntityResolver that is used by the XMLReader for validation.
protected abstract  String[] getIncludes()
           
protected  Map<String,String> getTestDocuments()
           
 
Methods inherited from class org.apache.maven.doxia.xsd.AbstractXmlValidator
addNamespaces, isFailErrorMessage, tearDown, testValidateFiles
 
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
 
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, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbstractXmlValidatorTest

public AbstractXmlValidatorTest()
Method Detail

getIncludes

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

getTestDocuments

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

getEntityResolver

protected EntityResolver getEntityResolver()
Returns the EntityResolver that is used by the XMLReader for validation. By default a AbstractXmlParser.CachedFileEntityResolver is used, but implementations should override this for performance reasons.

Specified by:
getEntityResolver in class AbstractXmlValidator
Returns:
an EntityResolver. Not null.
Since:
1.2

getAllTestDocuments

protected static Map<String,String> getAllTestDocuments()
                                                 throws IOException
Find test resources in the doxia-test-docs-XXX.jar or in an IDE project.

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-2013 The Apache Software Foundation. All Rights Reserved.