Пример #1
0
 @Test
 public void testReadWriteExternal() throws IOException, ClassNotFoundException, ISOException {
   // given
   ByteArrayOutputStream data = new ByteArrayOutputStream();
   ObjectOutputStream ostr = new ObjectOutputStream(data);
   // when
   iSOAmount.writeExternal(ostr);
   ostr.close();
   ObjectInputStream istr = new ObjectInputStream(new ByteArrayInputStream(data.toByteArray()));
   // then
   ISOAmount pickled = new ISOAmount();
   pickled.readExternal(istr);
   istr.close();
   assertThat(pickled.getAmountAsString(), is(iSOAmount.getAmountAsString()));
 }
Пример #2
0
 @Test
 public void testGetAmountAsString() throws ISOException {
   assertThat(iSOAmount.getAmountAsString(), is("8402000000001000"));
 }