@Test
public void CopyElementData() throws Exception
{
final ElementData a = new ElementData( CopyTestElementRoot.TYPE );
ElementData ac1;
ElementData ac2;
List<ElementData> list;
a.write( "ValueProperty1", "abc" );
a.write( "ValueProperty2", 5 );
a.write( "ValueProperty3", null );
ac1 = new ElementData( CopyTestElementChild.TYPE );
a.write( "ImpliedElementProperty1", ac1 );
ac1.write( "ValueProperty1", "implied-1" );
ac2 = new ElementData( CopyTestElementChildEx.TYPE );
a.write( "ImpliedElementProperty2", ac2 );
ac2.write( "ValueProperty1", "implied-2-a" );
ac2.write( "ValueProperty2", "implied-2-b" );
ac1 = new ElementData( CopyTestElementChild.TYPE );
a.write( "ElementProperty1", ac1 );
ac1.write( "ValueProperty1", "element-1" );
ac2 = new ElementData( CopyTestElementChildEx.TYPE );
a.write( "ElementProperty2", ac2 );
ac2.write( "ValueProperty1", "element-2-a" );
ac2.write( "ValueProperty2", "element-2-b" );
list = new ArrayList<ElementData>();
a.write( "ListProperty1", list );
ac1 = new ElementData( CopyTestElementChild.TYPE );
list.add( ac1 );
ac1.write( "ValueProperty1", "list-1-a" );
ac1 = new ElementData( CopyTestElementChild.TYPE );
list.add( ac1 );
ac1.write( "ValueProperty1", "list-1-b" );
ac1 = new ElementData( CopyTestElementChild.TYPE );
list.add( ac1 );
ac1.write( "ValueProperty1", "list-1-c" );
list = new ArrayList<ElementData>();
a.write( "ListProperty2", list );
ac1 = new ElementData( CopyTestElementChild.TYPE );
list.add( ac1 );
ac1.write( "ValueProperty1", "list-2-a" );
ac2 = new ElementData( CopyTestElementChildEx.TYPE );
list.add( ac2 );
ac2.write( "ValueProperty1", "list-2-b-a" );
ac2.write( "ValueProperty2", "list-2-b-b" );
ac2 = new ElementData( CopyTestElementChildEx.TYPE );
list.add( ac2 );
ac2.write( "ValueProperty1", "list-2-c-a" );
ac2.write( "ValueProperty2", "list-2-c-b" );
final Object t = new Object();
a.write( "TransientProperty", t );
final CopyTestElementRoot b = CopyTestElementRoot.TYPE.instantiate();