commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject cvs commit: jakarta-commons/digester/src/test/org/apache/commons/digester SetNestedPropertiesRuleTestCase.java
Date Tue, 30 Nov 2004 04:36:46 GMT
skitching    2004/11/29 20:36:46

  Modified:    digester/src/test/org/apache/commons/digester
                        SetNestedPropertiesRuleTestCase.java
  Log:
  Added test case for bugzilla#31393, reported by James Pine.
  SetNestedPropertiesRule fails when invoked re-entrantly.
  
  Revision  Changes    Path
  1.4       +33 -1     jakarta-commons/digester/src/test/org/apache/commons/digester/SetNestedPropertiesRuleTestCase.java
  
  Index: SetNestedPropertiesRuleTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/test/org/apache/commons/digester/SetNestedPropertiesRuleTestCase.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SetNestedPropertiesRuleTestCase.java	7 May 2004 01:29:59 -0000	1.3
  +++ SetNestedPropertiesRuleTestCase.java	30 Nov 2004 04:36:46 -0000	1.4
  @@ -330,6 +330,38 @@
           assertNotNull(bean);
       }
   
  +    /**
  +     * 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.
  +     * <p>
  +     * See bugzilla entry 31393.
  +     */
  +    public void testRecursiveNestedProperties()
  +        throws SAXException, IOException {
  +
  +        String testXml =
  +            "<?xml version='1.0'?>" +
  +            "<testbean>" +
  +                "<beta>BETA BODY</beta>" +
  +                "<testbean>" +
  +                    "<beta>BETA BODY</beta>" +
  +                "</testbean>" +
  +            "</testbean>";
  +
  +        Reader reader = new StringReader(testXml);
  +
  +        // going to be setting properties on a SimpleTestBean
  +        digester.addObjectCreate("*/testbean",
  +                                 "org.apache.commons.digester.SimpleTestBean");
  +
  +        SetNestedPropertiesRule rule = new SetNestedPropertiesRule();
  +        rule.setAllowUnknownChildElements(true);
  +        digester.addRule("*/testbean", rule);
  +
  +        SimpleTestBean bean = (SimpleTestBean) digester.parse(reader);
  +        assertNotNull(bean);
  +    }
  +
   
       /**
        * Get input stream from {@link #TEST_XML}.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message