Save This Page
Home » commons-digester-1.8-src » org.apache.commons » digester » [javadoc | source]
org.apache.commons.digester
public class: SetNestedPropertiesRuleTestCase [javadoc | source]
java.lang.Object
   junit.framework.TestCase
      org.apache.commons.digester.SetNestedPropertiesRuleTestCase

Test case for SetNestedPropertiesRule. This contains tests for the main applications of the rule and two more general tests of digester functionality used by this rule.
Field Summary
protected static final  String TEST_XML    Simple test xml document used in the tests. 
protected  Digester digester    The digester instance we will be processing. 
Constructor:
 public SetNestedPropertiesRuleTestCase(String name) 
    Construct a new instance of this test case.
    Parameters:
    name - Name of the test case
Method from org.apache.commons.digester.SetNestedPropertiesRuleTestCase Summary:
setUp,   suite,   tearDown,   testAutomaticallySetProperties,   testCustomisedProperties1,   testCustomisedProperties2a,   testCustomisedProperties2b,   testMandatoryProperties,   testMultiRuleMatch,   testRecursiveNestedProperties,   testUnknownChildrenCausesException,   testUnknownChildrenExceptionOverride
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.commons.digester.SetNestedPropertiesRuleTestCase Detail:
 public  void setUp() 
    Set up instance variables required by this test case.
 public static Test suite() 
    Return the tests included in this test suite.
 public  void tearDown() 
    Tear down instance variables required by this test case.
 public  void testAutomaticallySetProperties() throws IOException, SAXException 
    Test that you can successfully automatically set properties.
 public  void testCustomisedProperties1() throws IOException, SAXException 
    Test that you can customise the property mappings using the constructor which takes arrays-of-strings.
 public  void testCustomisedProperties2a() throws IOException, SAXException 
    Test that you can ignore a single input xml element using the constructor which takes a single remapping.
 public  void testCustomisedProperties2b() throws IOException, SAXException 
    Test that you can customise the property mappings using the constructor which takes a single remapping.
 public  void testMandatoryProperties() throws IOException, SAXException 
    Test that it is an error when a child element exists but no corresponding java property exists.
 public  void testMultiRuleMatch() throws IOException, SAXException 
    Test that:
    • you can have rules matching the same pattern as the SetNestedPropertiesRule,
    • you can have rules matching child elements of the rule,
    • the Rules object is reset nicely.
 public  void testRecursiveNestedProperties() throws IOException, SAXException 
    Test that the rule works in a sane manner when the associated pattern is a wildcard such that the rule matches one of its own child elements.

    See bugzilla entry 31393.

 public  void testUnknownChildrenCausesException() throws IOException, SAXException 
    Test that unknown child elements trigger an exception.
 public  void testUnknownChildrenExceptionOverride() throws IOException, SAXException 
    Test that unknown child elements are allowed if the appropriate flag is set.