net.sf.xmlmatcher
Class Main

java.lang.Object
  extended by net.sf.xmlmatcher.Main

public class Main
extends java.lang.Object

Matcher facade. Assembles matchers and listeners in default configuration.


Constructor Summary
Main()
           
 
Method Summary
static void main(java.lang.String[] args)
          Match two files specified by command line arguments
static Matcher makeDefaultMatcher()
           
static void match(org.w3c.dom.Element template, org.w3c.dom.Element actual)
          Match two given elements using default matcher configuration
static void match(java.io.File template, java.io.File actual)
          Match two given files using default matcher configuration
static void match(org.xml.sax.InputSource template, org.xml.sax.InputSource actual)
          Match two given input sources using default matcher configuration
static void match(java.io.InputStream template, java.io.InputStream actual)
          Match two given input streams using default matcher configuration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Main

public Main()
Method Detail

makeDefaultMatcher

public static Matcher makeDefaultMatcher()
Returns:
Default chain of XML Matchers:
  1. TagNamesMatcher - matches element namespace and tag names
  2. AttributesMatcher - matches value of attributes
  3. StrategyBasedMatcher - matches text-based values and XML structures
  4. JsProcessor - executes matching assertions
Top level matcher has EquivalencyChecker.

match

public static void match(java.io.File template,
                         java.io.File actual)
                  throws java.io.IOException,
                         MatcherException
Match two given files using default matcher configuration

Parameters:
template - File with template document
actual - File with actual document
Throws:
java.io.IOException - if files cannot be read
MatcherException - if files mismatch

match

public static void match(java.io.InputStream template,
                         java.io.InputStream actual)
                  throws java.io.IOException,
                         MatcherException
Match two given input streams using default matcher configuration

Parameters:
template - Template document input stream
actual - Actual document input stream
Throws:
java.io.IOException - if input stream cannot be read
MatcherException - if documents mismatch

match

public static void match(org.xml.sax.InputSource template,
                         org.xml.sax.InputSource actual)
                  throws java.io.IOException,
                         MatcherException
Match two given input sources using default matcher configuration

Parameters:
template - Template document input source
actual - Actual document input source
Throws:
java.io.IOException - if input sources cannot be read
MatcherException - if documents mismatch

match

public static void match(org.w3c.dom.Element template,
                         org.w3c.dom.Element actual)
                  throws MatcherException
Match two given elements using default matcher configuration

Parameters:
template - Template element
actual - Actual element
Throws:
MatcherException - if elements mismatch

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException,
                        MatcherException
Match two files specified by command line arguments

Throws:
java.io.IOException
MatcherException


Copyright © 2007. All Rights Reserved.