@Test
public void longPropertyUpdateXmlSaveLoad() throws PropertyValidationException, JAXBException {
long value = new Random().nextLong();
if (1 == value) {
value++;
}
LongProperty longProperty = new LongProperty("name", "description", "logical-name", Long.valueOf(1), false, false);
AbstractPropertyUpdate<Long> longPropertyUpdate = longProperty.createAndValidatePropertyUpdate(Long.valueOf(value));
JAXBContext context = JAXBContext.newInstance(LongPropertyUpdate.class);
Marshaller marshaller = context.createMarshaller();
Unmarshaller unmarshaller = context.createUnmarshaller();
marshaller.marshal(longPropertyUpdate, f);
Object object = unmarshaller.unmarshal(f);
assertThat(object, is(instanceOf(LongPropertyUpdate.class)));
LongPropertyUpdate unmarsalled = (LongPropertyUpdate) object;
assertThat(longProperty.canUpdate(unmarsalled), is(true));
longProperty.setValue(unmarsalled.getUpdateValue());
assertThat(longProperty.getValue().longValue(), is(value));
}