コード例 #1
0
ファイル: ISOAmountTest.java プロジェクト: krauz0/jPOS
 @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
ファイル: ISOAmountTest.java プロジェクト: krauz0/jPOS
 @Test
 public void testGetAmountAsString() throws ISOException {
   assertThat(iSOAmount.getAmountAsString(), is("8402000000001000"));
 }