edu.vub.at.actors.natives
Class SerializationTest

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byedu.vub.at.AmbientTalkTest
              extended byedu.vub.at.actors.natives.SerializationTest
All Implemented Interfaces:
junit.framework.Test

public class SerializationTest
extends AmbientTalkTest

A test case for object serialization.

Author:
tvcutsem

Nested Class Summary
 
Nested classes inherited from class edu.vub.at.AmbientTalkTest
AmbientTalkTest.Actorscript
 
Field Summary
 
Fields inherited from class edu.vub.at.AmbientTalkTest
ctx_
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
SerializationTest()
           
 
Method Summary
private  java.lang.Object copy(java.lang.Object o)
           
private  java.lang.Object deserialize(byte[] b)
           
private  byte[] serialize(java.lang.Object o)
           
 void testAGSerialization()
           
 void testCoercerSerialization()
          Tests whether a coercer correctly implements writeReplace to return the principal to serialize, instead of the coercer itself.
 void testParseTreeSerialization()
           
 void testTXTSerialization()
           
 
Methods inherited from class edu.vub.at.AmbientTalkTest
actorTest, evalActor, evalAndCompareTo, evalAndCompareTo, evalAndReturn, evalAndTestException, evalInActor, evalSnippet, printedEquals
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SerializationTest

public SerializationTest()
Method Detail

serialize

private byte[] serialize(java.lang.Object o)
                  throws java.io.IOException
Throws:
java.io.IOException

deserialize

private java.lang.Object deserialize(byte[] b)
                              throws java.io.IOException,
                                     java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

copy

private java.lang.Object copy(java.lang.Object o)
                       throws java.io.IOException,
                              java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

testTXTSerialization

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

testAGSerialization

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

testParseTreeSerialization

public void testParseTreeSerialization()
                                throws InterpreterException
Throws:
InterpreterException

testCoercerSerialization

public void testCoercerSerialization()
                              throws InterpreterException
Tests whether a coercer correctly implements writeReplace to return the principal to serialize, instead of the coercer itself. Hence, upon deserialization, we expect an object that is no longer wrapped by a coercer.

Throws:
InterpreterException