org.apache.maven.doxia.xsd
Class AbstractXmlValidator

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

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

Abstract class to validate XML files.

Since:
1.2
Author:
ltheussl

Field Summary
protected static String EOL
           
 
Fields inherited from class org.codehaus.plexus.PlexusTestCase
container, context
 
Constructor Summary
AbstractXmlValidator()
           
 
Method Summary
protected abstract  String addNamespaces(String content)
           
protected abstract  EntityResolver getEntityResolver()
          Returns the EntityResolver that is used by the XMLReader for validation.
protected abstract  Map<String,String> getTestDocuments()
           
protected  boolean isFailErrorMessage(String message)
          Filter fail message.
protected  void tearDown()
           
 void testValidateFiles()
          Validate the test documents returned by getTestDocuments() with DTD or XSD using xerces.
 
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
 

Field Detail

EOL

protected static final String EOL
Constructor Detail

AbstractXmlValidator

public AbstractXmlValidator()
Method Detail

isFailErrorMessage

protected boolean isFailErrorMessage(String message)
Filter fail message.

Parameters:
message - not null
Returns:
true if the given message will fail the test.
Since:
1.1.1

tearDown

protected void tearDown()
                 throws Exception
Overrides:
tearDown in class org.codehaus.plexus.PlexusTestCase
Throws:
Exception

testValidateFiles

public void testValidateFiles()
                       throws Exception
Validate the test documents returned by getTestDocuments() with DTD or XSD using xerces.

Throws:
Exception - if any
See Also:
addNamespaces(String), getTestDocuments()

addNamespaces

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

getTestDocuments

protected abstract Map<String,String> getTestDocuments()
                                                throws IOException
Returns:
a Map < filePath, fileContent > of files to validate.
Throws:
IOException - if any

getEntityResolver

protected abstract EntityResolver getEntityResolver()
Returns the EntityResolver that is used by the XMLReader for validation.

Returns:
an EntityResolver. Not null.


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