commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rdon...@apache.org
Subject cvs commit: jakarta-commons/betwixt/src/test/org/apache/commons/betwixt TestBeanWriter.java
Date Fri, 25 Apr 2003 11:19:34 GMT
rdonkin     2003/04/25 04:19:34

  Modified:    betwixt/src/test/org/apache/commons/betwixt
                        TestBeanWriter.java
  Log:
  Improved test cases
  
  Revision  Changes    Path
  1.13      +22 -1     jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/TestBeanWriter.java
  
  Index: TestBeanWriter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/TestBeanWriter.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestBeanWriter.java	24 Apr 2003 18:29:59 -0000	1.12
  +++ TestBeanWriter.java	25 Apr 2003 11:19:34 -0000	1.13
  @@ -76,7 +76,7 @@
   import org.apache.commons.logging.impl.SimpleLog;
   import org.apache.commons.betwixt.digester.XMLIntrospectorHelper;
   import org.apache.commons.betwixt.strategy.CapitalizeNameMapper;
  -
  +import org.apache.commons.betwixt.strategy.HyphenatedNameMapper;
   
   /** Test harness for the BeanWriter
     *
  @@ -565,6 +565,27 @@
            + "<NameBean><Name>All Things Nice</Name></NameBean>"

            + "</Things>"
            +"</NoAdderBean>";
  +         
  +        xmlAssertIsomorphicContent(
  +                            parseString(out.getBuffer().toString()),
  +                            parseString(xml), 
  +                            true);
  +                            
  +        out = new StringWriter();
  +        out.write("<?xml version='1.0'?>");
  +        writer = new BeanWriter(out);
  +        writer.setWriteEmptyElements(true);
  +        writer.getXMLIntrospector().setWrapCollectionsInElement(true);
  +        writer.setWriteIDs(false);
  +        writer.getXMLIntrospector().setElementNameMapper(new HyphenatedNameMapper(false));
  +        writer.write(bean);
  +        
  +        xml = "<?xml version='1.0'?><no-adder-bean><things>"
  +         + "<name-bean><name>Sugar</name></name-bean>" 
  +         + "<name-bean><name>Spice</name></name-bean>" 
  +         + "<name-bean><name>All Things Nice</name></name-bean>"

  +         + "</things>"
  +         +"</no-adder-bean>";
            
           xmlAssertIsomorphicContent(
                               parseString(out.getBuffer().toString()),
  
  
  

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