final TestCommand unmarshalledCommand = _jsonHandler.unmarshall(json, TestCommand.class);
Map<String, PropertyValue> properties = unmarshalledCommand.getMessageProperties();
assertNotNull("Properties should not be null", properties);
assertFalse("Properties should not be empty", properties.isEmpty());
assertEquals("Unexpected properties size", 2, properties.size());
PropertyValue testProperty = properties.get("test");
assertNotNull("Unexpected property test", testProperty);
assertTrue("Unexpected property test", testProperty.getValue() instanceof Number);
assertEquals("Unexpected property value", 1, ((Number)testProperty.getValue()).intValue());
Object generatorObject = properties.get("generator");
assertTrue("Unexpected generator object", generatorObject instanceof ListPropertyValue);
PropertyValue generator = (PropertyValue)generatorObject;
assertEquals("Unexpected generator value", "first", generator.getValue());
for (int i = 0; i < 10; i++)
{
assertEquals("Unexpected generator value", new Integer(i), generator.getValue());
}
String newJson =_jsonHandler.marshall(unmarshalledCommand);
final TestCommand newUnmarshalledCommand = _jsonHandler.unmarshall(newJson, TestCommand.class);
assertEquals("Unmarshalled command should be equal to the original object", unmarshalledCommand, newUnmarshalledCommand);
}