org.jibx.maven
Class DocumentCompareMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.jibx.maven.AbstractJibxMojo
          extended by org.jibx.maven.DocumentCompareMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

public class DocumentCompareMojo
extends AbstractJibxMojo

Compares two schemas or roundtrips a schema through a JiBX class and compares the results. If a mapped class is supplied, then the inFile is marshalled into the supplied class and then unmarshalled in the outFile (defaults to temp.xml) and compared with the original xml document. If no class is supplied, then the inFile is compared to the outFile XML files. Note: This mojo only runs in test scope.

Author:
Don Corley

Nested Class Summary
static class DocumentCompareMojo.MyTestRoundtrip
          Note: this is a hack to increase the visibility of runTest so I can call it.
 
Field Summary
 
Fields inherited from class org.jibx.maven.AbstractJibxMojo
project
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
DocumentCompareMojo()
           
 
Method Summary
protected  void checkConfiguration()
          Verifies the plugins configuration and sets default values if needed.
 void execute()
          Run the comparison.
protected  Set<String> getProjectCompileClasspathElements(org.apache.maven.project.MavenProject project)
          Returns the build output directory of the given project.
protected  String getXmlDirectory()
          Get the document files directory.
 
Methods inherited from class org.jibx.maven.AbstractJibxMojo
addDependentArtifact, addDependentBinding, addManualDependentBinding, extractBaseBindingFile, fixFilePath, getBaseBindingDirectory, getBaseBindings, getFullPath, getIncludedFiles, getProjectBasedir, getSchemaBindingDirectory
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentCompareMojo

public DocumentCompareMojo()
Method Detail

execute

public void execute()
             throws org.apache.maven.plugin.MojoExecutionException,
                    org.apache.maven.plugin.MojoFailureException
Run the comparison.

Specified by:
execute in interface org.apache.maven.plugin.Mojo
Specified by:
execute in class AbstractJibxMojo
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

checkConfiguration

protected void checkConfiguration()
Verifies the plugins configuration and sets default values if needed. Note: Remember to call inherited methods first.

Overrides:
checkConfiguration in class AbstractJibxMojo

getXmlDirectory

protected String getXmlDirectory()
Get the document files directory.

Returns:
The document files directory.

getProjectCompileClasspathElements

protected Set<String> getProjectCompileClasspathElements(org.apache.maven.project.MavenProject project)
                                                  throws org.apache.maven.plugin.MojoExecutionException
Returns the build output directory of the given project.

Specified by:
getProjectCompileClasspathElements in class AbstractJibxMojo
Throws:
org.apache.maven.plugin.MojoExecutionException - if DependencyResolutionRequiredException occurs


Copyright © 2005-2011 jibx.org. All Rights Reserved.