use of java.io.ObjectOutput in project jPOS by jpos.
the class ISOAmountTest method testBadWriteAttemptISOException.
@Test
public void testBadWriteAttemptISOException() throws IOException {
iSOAmount = new ISOAmount() {
@Override
public Object getValue() throws ISOException {
throw new ISOException("boo!");
}
};
ObjectOutput oo = mock(ObjectOutput.class);
try {
iSOAmount.writeExternal(oo);
} catch (IOException ioe) {
assertThat(ioe.getMessage(), is("org.jpos.iso.ISOException: boo!"));
}
}
use of java.io.ObjectOutput in project jPOS by jpos.
the class ISOFieldPackagerTest method testPackThrowsNullPointerException.
@SuppressWarnings("deprecation")
@Test
public void testPackThrowsNullPointerException() throws Throwable {
ObjectOutput out = new ObjectOutputStream(new ByteArrayOutputStream());
try {
new IF_ECHAR(100, "testISOFieldPackagerDescription").pack(new ISOField(), out);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of java.io.ObjectOutput in project jPOS by jpos.
the class ISOFieldTest method testWriteExternal.
@Test
public void testWriteExternal() throws Throwable {
ObjectOutput out = new ObjectOutputStream(new ByteArrayOutputStream());
new ISOVField(new ISOField(100, "testISOFieldv"), new ISOVError("testISOFieldDescription", "testISOFieldRejectCode")).writeExternal(out);
}
use of java.io.ObjectOutput in project jPOS by jpos.
the class ISOFieldTest method testWriteExternalThrowsNullPointerException.
@Test
public void testWriteExternalThrowsNullPointerException() throws Throwable {
ObjectOutput out = new ObjectOutputStream(new ByteArrayOutputStream());
try {
new ISOField(100).writeExternal(out);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of java.io.ObjectOutput in project jPOS by jpos.
the class ISOMsg2Test method testWriteExternal.
@Test
public void testWriteExternal() throws Throwable {
ObjectOutput out = new ObjectOutputStream(new ByteArrayOutputStream());
ISOMsg iSOMsg = new ISOMsg("testISOMsgMti");
iSOMsg.setPackager(new GenericPackager());
iSOMsg.writeExternal(out);
assertNull("iSOMsg.header", iSOMsg.header);
// int actual = ;
}
Aggregations