}
public void testTransformPrimitives()
{
// build source message
TransferObject msg = new TransferObject("TransformTestMsg", 4);
TransferObject msg1 = null;
ArrayList col = null;
ArrayList col1 = null;
msg.setValue("primitive", new Integer(0));
col = new ArrayList(2);
col.add(new Integer(4));
col.add(new Integer(5));
msg.setValue("primitiveCollection", col);
msg1 = new TransferObject(2);
msg1.setValue("primitive", new Integer(10));
col = new ArrayList(2);
col.add(new Integer(14));
col.add(new Integer(15));
msg1.setValue("primitiveCollection", col);
msg.setValue("message", msg1);
col1 = new ArrayList(2);
msg1 = new TransferObject(2);
msg1.setValue("primitive", new Integer(20));
col = new ArrayList(2);
col.add(new Integer(24));
col.add(new Integer(25));
msg1.setValue("primitiveCollection", col);
col1.add(msg1);
msg1 = new TransferObject(2);
msg1.setValue("primitive", new Integer(30));
col = new ArrayList(2);
col.add(new Integer(34));
col.add(new Integer(35));
msg1.setValue("primitiveCollection", col);
col1.add(msg1);
msg.setValue("messageCollection", col1);
// transform message
TransferObject res = m_tf.transform(msg, m_metadata.getTransformation("MapPrimitive"));
// validate result message
assertEquals("TransformTestMsg", res.getClassName());
assertEquals(4, res.getValueCount());
assertEquals(new Integer(0), res.getValue("primitive"));
col = (ArrayList)res.getValue("primitiveCollection");
assertEquals(4, col.size());
assertEquals(new Integer(0), col.get(0));
assertEquals(new Integer(1), col.get(1));
assertEquals(new Integer(2), col.get(2));
assertEquals(new Integer(3), col.get(3));
msg = (TransferObject)res.getValue("message");
assertEquals(2, msg.getValueCount());
assertEquals(new Integer(15), msg.getValue("primitive"));
col = (ArrayList)msg.getValue("primitiveCollection");
assertEquals(4, col.size());
assertEquals(new Integer(14), col.get(0));
assertEquals(new Integer(14), col.get(1));
assertEquals(new Integer(15), col.get(2));
assertEquals(new Integer(15), col.get(3));
col = (ArrayList)res.getValue("messageCollection");
assertEquals(2, col.size());
msg = (TransferObject)col.get(0);
assertEquals(2, msg.getValueCount());