ch.elca.el4j.tests.xmlmerge
Class DefaultMergeTest

java.lang.Object
  extended by ch.elca.el4j.tests.xmlmerge.DefaultMergeTest

public class DefaultMergeTest
extends Object

This class tests several functionalities of the xml_merge module, using a DefaultXmlMerge instance.

Author:
Laurent Bovet (LBO), Alex Mathey (AMA)
File-location:
DefaultMergeTest
Last check-in date:
2009-12-01 10:59:54 +0100 (Di, 01. Dez 2009) by jonasha for revision 4010

Nested Class Summary
(package private)  class DefaultMergeTest.NonNetworkIbatisResolver
          private EntityResolver that does not use the network.
static class DefaultMergeTest.ServletNameMatcher
          This class is a custom matcher.
 
Field Summary
private static org.slf4j.Logger logger
           
static String NL
          New line.
 
Constructor Summary
DefaultMergeTest()
           
 
Method Summary
 void testAttributeMerge()
          Tests configuration of an XmlMerge instance with inline attributes in the patch document.
 void testAttributes()
          Tests a merge of an element's attributes.
 void testCustomMatcher()
          Tests a merge using a custom matcher.
 void testDtdMerge()
          Tests a DTD merge of two source files using a DtdInsertAction: inserts the patch elements in the result according to the order specified in the original document's DTD.
 void testIdMapper()
          Tests a merge using the IdentityMapper.
 void testInsertAction()
          Tests the InsertAction in conjunction with the SkipMatcher, inserting the patch elements after the original elements of the same tag in the result.
 void testPropertyXPathConfigurer()
          Tests configuration of an XmlMerge instance with XPath and Properties, using a PropertyXPathConfigurer.
 void testSimpleMerge()
          Tests a simple merge of two strings.
 void testSpringResource()
          Tests the creation of an XML Spring Resource on-the-fly by merging XML documents read from other resources.
 void testThreeMerges()
          Tests a merge of three strings.
 void testXPathOperationFactory()
          Tests programmatic configuration of an XmlMerge instance, using an XPathOperationFactory.
private  void writeFromTo(InputStream in, OutputStream out)
          Writes from an InputStream to an OutputStream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static org.slf4j.Logger logger

NL

public static final String NL
New line.

Constructor Detail

DefaultMergeTest

public DefaultMergeTest()
Method Detail

testSimpleMerge

public void testSimpleMerge()
                     throws Exception
Tests a simple merge of two strings.

Throws:
Exception - If an error occurs during the test

testThreeMerges

public void testThreeMerges()
                     throws Exception
Tests a merge of three strings.

Throws:
Exception - If an error occurs during the test

testXPathOperationFactory

public void testXPathOperationFactory()
                               throws Exception
Tests programmatic configuration of an XmlMerge instance, using an XPathOperationFactory.

Throws:
Exception - If an error occurs during the test

testPropertyXPathConfigurer

public void testPropertyXPathConfigurer()
                                 throws Exception
Tests configuration of an XmlMerge instance with XPath and Properties, using a PropertyXPathConfigurer.

Throws:
Exception - If an error occurs during the test

testInsertAction

public void testInsertAction()
                      throws Exception
Tests the InsertAction in conjunction with the SkipMatcher, inserting the patch elements after the original elements of the same tag in the result.

Throws:
Exception - If an error occurs during the test

testSpringResource

public void testSpringResource()
                        throws Exception
Tests the creation of an XML Spring Resource on-the-fly by merging XML documents read from other resources.

Throws:
Exception - If an error occurs during the test

testDtdMerge

public void testDtdMerge()
                  throws Exception
Tests a DTD merge of two source files using a DtdInsertAction: inserts the patch elements in the result according to the order specified in the original document's DTD.

Throws:
Exception - If an error occurs during the test

testAttributes

public void testAttributes()
                    throws Exception
Tests a merge of an element's attributes.

Throws:
Exception - If an error occurs during the test

testIdMapper

public void testIdMapper()
                  throws Exception
Tests a merge using the IdentityMapper.

Throws:
Exception - If an error occurs during the test

testAttributeMerge

public void testAttributeMerge()
                        throws Exception
Tests configuration of an XmlMerge instance with inline attributes in the patch document.

Throws:
Exception - If an error occurs during the test

writeFromTo

private void writeFromTo(InputStream in,
                         OutputStream out)
Writes from an InputStream to an OutputStream.

Parameters:
in - The InputStream to read from
out - The Outputstream to write to

testCustomMatcher

public void testCustomMatcher()
                       throws Exception
Tests a merge using a custom matcher.

Throws:
Exception - If an error occurs during the test


Copyright © 2005-2011 ELCA. All Rights Reserved.