openamf/src/java/org/openamf/io AMFSerializerTest.java,NONE,1.1

[email protected] Wed, 20 Aug 2003 12:01:19 -0700
Newsgroups gmane.comp.java.openamf.cvs
Message-ID <[email protected]>
Update of /cvsroot/openamf/openamf/src/java/org/openamf/io
In directory sc8-pr-cvs1:/tmp/cvs-serv29741/src/java/org/openamf/io

Added Files:
	AMFSerializerTest.java 
Log Message:
integrated junit testing

--- NEW FILE: AMFSerializerTest.java ---
package org.openamf.io;

import java.util.*;
import java.lang.reflect.*;
import java.io.*;
import org.apache.commons.beanutils.*;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.log4j.*;
import org.openamf.*;
import junit.framework.*;

public class AMFSerializerTest
  extends TestCase
{
  private static final Logger log = Logger.getLogger(AMFSerializerTest.class);

  public AMFSerializerTest(String name)
  {
    super(name);
  }

  public static Test suite()
  {
    TestSuite suite = new TestSuite(AMFSerializerTest.class);
    return suite;
  }

  public void testSerializeMessage() throws Exception
  {
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    AMFSerializer serializer = new AMFSerializer(new DataOutputStream(output));
    AMFMessage message = getTestMessage();
    serializer.serializeMessage(message);

    // what else can we assert on the resulting output stream?
    assertTrue(output.toByteArray().length > 0);
  }

  private AMFMessage getTestMessage()
  {
    AMFMessage message = new AMFMessage();
    message.addHeader("testKey", true, "testValue");
    message.addBody("someService.someMethod", "someResponse", "body value", AMFBody.DATA_TYPE_STRING);
    return message;
  }
}




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0