Package cc.mallet.types.tests
Class TestSerializable
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- 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:
- casutton@cs.umass.edu
-
-
Constructor Summary
Constructors Constructor Description TestSerializable(java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
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, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
-
-
-
-
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
-
-