final Object otherList = doRoundTrip(list);
assertEquals(list, otherList);
}
public void testListWithNumbers() throws Exception {
final ImmutableListValue list = (ImmutableListValue) unmarshall(
getResourceAsString("res/list-with-numbers.xml"),
ImmutableListValueImpl.class);
// check the created object
final List expectedList = new LinkedList();
MutableNumberValue value = new MutableNumberValueImpl();
value.setValue(new Byte((byte) 42));
expectedList.add(value.createImmutable());
value.setValue(new Short((short) 1));
expectedList.add(value.createImmutable());
value.setValue(new Integer(2));
expectedList.add(value.createImmutable());
value.setValue(new Long(3));
expectedList.add(value.createImmutable());
value.setValue(new BigInteger("4"));
expectedList.add(value.createImmutable());
value.setValue(new BigDecimal("4.2"));
expectedList.add(value.createImmutable());
value.setValue(new Float(0.1f));
expectedList.add(value.createImmutable());
value.setValue(new Double(0.2d));
expectedList.add(value.createImmutable());
assertEquals(expectedList, list.getContentsAsList());
final Object otherList = doRoundTrip(list);
assertEquals(list, otherList);
}