cc.mallet.types.tests
Class TestSerializable

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by cc.mallet.types.tests.TestSerializable
All Implemented Interfaces:
junit.framework.Test

public class TestSerializable
extends junit.framework.TestCase

Static utility for testing serializable classes in MALLET. Created: Aug 24, 2004

Version:
$Id: TestSerializable.java,v 1.1 2007/10/22 21:37:55 mccallum Exp $
Author:
Constructor Summary
TestSerializable(java.lang.String name)
           
 
Method Summary
static java.lang.Object cloneViaSerialization(java.io.Serializable obj)
          Clones a given object by serializing it to a byte array and reading it back.
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testTestSerializable()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail, failNotEquals, failNotSame, failSame, format
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestSerializable

public TestSerializable(java.lang.String name)
Method Detail

suite

public static junit.framework.Test suite()

cloneViaSerialization

public static java.lang.Object cloneViaSerialization(java.io.Serializable obj)
                                              throws java.io.IOException,
                                                     java.lang.ClassNotFoundException
Clones a given object by serializing it to a byte array and reading it back. This is useful for testing serialization methods.

Parameters:
obj -
Returns:
A copy of obj.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

testTestSerializable

public void testTestSerializable()
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

main

public static void main(java.lang.String[] args)
                 throws java.lang.Throwable
Throws:
java.lang.Throwable