Package siena.remote

Examples of siena.remote.XmlSerializer


import siena.remote.XmlSerializer;

public class XmlSerializerTest extends TestCase {
 
  public void testXmlSerializer() throws Exception {
    XmlSerializer serializer = new XmlSerializer();
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
   
    Document document = DocumentHelper.createDocument();
    document.addElement("root");
    serializer.serialize(document, baos);
   
    Document result = serializer.deserialize(new ByteArrayInputStream(baos.toByteArray()));
   
    assertEquals(result.getRootElement().getName(),
        document.getRootElement().getName());
  }
View Full Code Here


    assertEquals(result.getRootElement().getName(),
        document.getRootElement().getName());
  }
 
  public void testDocumentException() {
    XmlSerializer serializer = new XmlSerializer();
    try {
      serializer.deserialize(new ByteArrayInputStream("[hello]".getBytes()));
    } catch(Exception e) {
      return;
    }
    fail("deserialize() should have been failed due to a DocumentException");
  }
View Full Code Here

TOP

Related Classes of siena.remote.XmlSerializer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.