com.ail.coretest
Class TestTypeClone

java.lang.Object
  extended by junit.framework.Assert
      extended by junit.framework.TestCase
          extended by com.ail.coretest.TestTypeClone
All Implemented Interfaces:
junit.framework.Test

public class TestTypeClone
extends junit.framework.TestCase

All classes in the type model must be cloneable - what's more the clone must done in a deep fashion. The tests in the is class check that the base classes manage this correctly.

Version:
$Revision: 1.8 $

Constructor Summary
TestTypeClone(java.lang.String name)
          Constructs a test case with the given name.
 
Method Summary
static void main(java.lang.String[] args)
           
static junit.framework.Test suite()
           
 void testCloneable()
          Test to ensure that a sample of the Type classes in the core are cloneable, and don't throw 'CloneNotSupported' exceptions when a clone is attempted.
 void testCommandClone()
           
 void testDeepCloneHistory()
           
 void testDeepCloneType()
          Types must clone their own attributes, this test checks that some of the Core's basic types handle this correctly.
 void testDeepCloneVersion()
           
 void testDeepCloneWithAttributes()
          An issue was raised with regards to the cloning of types (specifically Asset in the insurance model) that used Attributes.
 void testEnumCloning()
          Since JDK 1.5 java supports enumerated types.
 void testMapCloning()
           
 void testSetCloning()
           
 void testTypeWithHashtable()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, getName, run, run, runBare, setName, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TestTypeClone

public TestTypeClone(java.lang.String name)
Constructs a test case with the given name.

Method Detail

suite

public static junit.framework.Test suite()

main

public static void main(java.lang.String[] args)

testCloneable

public void testCloneable()
                   throws java.lang.Exception
Test to ensure that a sample of the Type classes in the core are cloneable, and don't throw 'CloneNotSupported' exceptions when a clone is attempted.

Throws:
java.lang.Exception

testDeepCloneType

public void testDeepCloneType()
                       throws java.lang.Exception
Types must clone their own attributes, this test checks that some of the Core's basic types handle this correctly.

Throws:
java.lang.Exception

testDeepCloneVersion

public void testDeepCloneVersion()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testDeepCloneHistory

public void testDeepCloneHistory()
                          throws java.lang.Exception
Throws:
java.lang.Exception

testCommandClone

public void testCommandClone()
                      throws java.lang.Exception
Throws:
java.lang.Exception

testTypeWithHashtable

public void testTypeWithHashtable()
                           throws java.lang.CloneNotSupportedException
Throws:
java.lang.CloneNotSupportedException

testDeepCloneWithAttributes

public void testDeepCloneWithAttributes()
                                 throws java.lang.Exception
An issue was raised with regards to the cloning of types (specifically Asset in the insurance model) that used Attributes. The Attributes were not being correctly cloned which meant that each instance of the type ended up sharing a collection of attributes so a change to an attribute on one asset showed up on all the other instances too. This test ensures that this bug is fixed.

Throws:
java.lang.Exception

testEnumCloning

public void testEnumCloning()
                     throws java.lang.Exception
Since JDK 1.5 java supports enumerated types. This test checks that our cloning code in the Type class correctly supports them.

Throws:
java.lang.Exception

testMapCloning

public void testMapCloning()
                    throws java.lang.Exception
Throws:
java.lang.Exception

testSetCloning

public void testSetCloning()
                    throws java.lang.Exception
Throws:
java.lang.Exception