예제 #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"));
 }