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 DigesterTestCase.java
Date Tue, 08 Jun 2004 08:26:47 GMT
skitching    2004/06/08 01:26:47

  Modified:    digester/src/test/org/apache/commons/digester
                        DigesterTestCase.java
  Log:
  Added test case for Digester.getRoot method.
  
  Revision  Changes    Path
  1.21      +19 -3     jakarta-commons/digester/src/test/org/apache/commons/digester/DigesterTestCase.java
  
  Index: DigesterTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/digester/src/test/org/apache/commons/digester/DigesterTestCase.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- DigesterTestCase.java	7 May 2004 01:29:59 -0000	1.20
  +++ DigesterTestCase.java	8 Jun 2004 08:26:47 -0000	1.21
  @@ -455,5 +455,21 @@
               "A named stack that has it's last object popped is empty", 
               digester.isEmpty(testStackName));
       }
  -    
  +
  +    /**
  +     * Test the Digester.getRoot method.
  +     */
  +    public void testGetRoot() throws Exception {
  +        Digester digester = new Digester();
  +        digester.addRule("root", new ObjectCreateRule(TestBean.class));
  +            
  +        String xml = "<root/>";
  +        InputSource in = new InputSource(new StringReader(xml));
  +        
  +        digester.parse(in);
  +        
  +        Object root = digester.getRoot();
  +        assertNotNull("root object not retrieved", root);
  +        assertTrue("root object not a TestRule instance", (root instanceof TestBean));
  +    }
   }
  
  
  

---------------------------------------------------------------------
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