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/recursion TestRecursion.java
Date Mon, 07 Jul 2003 18:44:55 GMT
rdonkin     2003/07/07 11:44:55

  Modified:    betwixt/src/test/org/apache/commons/betwixt/recursion
                        TestRecursion.java
  Log:
  Improved units tests
  
  Revision  Changes    Path
  1.10      +21 -6     jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/recursion/TestRecursion.java
  
  Index: TestRecursion.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/recursion/TestRecursion.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- TestRecursion.java	6 Jul 2003 21:10:34 -0000	1.9
  +++ TestRecursion.java	7 Jul 2003 18:44:55 -0000	1.10
  @@ -275,11 +275,18 @@
       public void testBeanWithIdProperty() throws Exception
       {
           IdBean bean = new IdBean("Hello, World");
  -        BeanWriter writer = new BeanWriter();
  +        bean.setNotId("Not ID");
  +        StringWriter out = new StringWriter();
  +        out.write("<?xml version='1.0'?>");
  +        BeanWriter writer = new BeanWriter(out);
           writer.setWriteEmptyElements( true );
           writer.getXMLIntrospector().setAttributesForPrimitives(true);
           writer.setWriteIDs(true);
           writer.write(bean);
  +        
  +        String xml = "<?xml version='1.0'?><IdBean notId='Not ID' id='Hello, World'/>";
  +        
  +        xmlAssertIsomorphic(parseString(xml), parseString(out.getBuffer().toString()),
true);
       }    
       
       /**
  @@ -302,6 +309,14 @@
           writer.setWriteEmptyElements( true );
           writer.setWriteIDs(false);
           writer.write(alpha);
  +
  +        String xml = "<?xml version='1.0'?><Element><name>Alpha</name><elements><element>"
  +                    + "<name>Beta</name><elements><element><name>Gamma</name><elements>"
  +                    + "<element><name>Epsilon</name><elements/></element></elements>"
  +                    + "</element></elements></element><element><name>Epsilon</name>"
  +                    + "<elements/></element></elements></Element>";
  +        
  +        xmlAssertIsomorphic(parseString(xml), parseString(stringWriter.getBuffer().toString()),
true);
       }    
   
       /**
  
  
  

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