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/introspection TestXMLIntrospector.java
Date Mon, 08 Sep 2003 14:20:08 GMT
rdonkin     2003/09/08 07:20:08

  Modified:    betwixt/src/test/org/apache/commons/betwixt/introspection
                        TestXMLIntrospector.java
  Log:
  Added another unit test
  
  Revision  Changes    Path
  1.7       +24 -5     jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/introspection/TestXMLIntrospector.java
  
  Index: TestXMLIntrospector.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/betwixt/src/test/org/apache/commons/betwixt/introspection/TestXMLIntrospector.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestXMLIntrospector.java	8 Sep 2003 14:00:47 -0000	1.6
  +++ TestXMLIntrospector.java	8 Sep 2003 14:20:07 -0000	1.7
  @@ -310,5 +310,24 @@
           assertEquals("Expected one elements", 1, children.length);
           assertEquals("Expected element", "name", children[0].getLocalName());
       }	    
  +    
  +    public void testListedClassNormalizerWrite() throws Exception {
  +        ListedClassNormalizer classNormalizer = new ListedClassNormalizer();
  +        classNormalizer.addSubstitution( IFace.class );
  +        
  +        StringWriter out = new StringWriter();
  +        out.write("<?xml version='1.0'?>");
  +        BeanWriter writer = new BeanWriter( out );
  +        writer.getXMLIntrospector().setClassNormalizer( classNormalizer );
  +        FaceImpl bean = new FaceImpl();
  +        bean.setName("Old Tom Cobbly");
  +        writer.write(bean);
  +        
  +        String xml="<?xml version='1.0'?><IFace><name>Old Tom Cobbly</name></IFace>";
  +        xmlAssertIsomorphicContent(
  +                            parseString(out.getBuffer().toString()),
  +                            parseString(xml), 
  +                            true);
  +    }	
   }
   
  
  
  

Mime
View raw message