use of org.jpos.iso.channel.BASE24Channel in project jPOS by jpos.
the class BaseChannelTest method testGetHeader.
@Test
public void testGetHeader() throws Throwable {
byte[] header = new byte[0];
BaseChannel bASE24Channel = new BASE24Channel(new ISO87APackager(), new ServerSocket());
bASE24Channel.setHeader(header);
byte[] result = bASE24Channel.getHeader();
assertSame("result", header, result);
}
use of org.jpos.iso.channel.BASE24Channel in project jPOS by jpos.
the class BaseChannelTest method testRemoveIncomingFilter.
@Test
public void testRemoveIncomingFilter() throws Throwable {
BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
bASE24Channel.removeIncomingFilter(new XSLTFilter());
assertEquals("(BASE24Channel) bASE24Channel.incomingFilters.size()", 0, ((BASE24Channel) bASE24Channel).incomingFilters.size());
}
use of org.jpos.iso.channel.BASE24Channel in project jPOS by jpos.
the class BaseChannelTest method testGetDynamicHeader1.
@Test
public void testGetDynamicHeader1() throws Throwable {
BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
ISOHeader result = bASE24Channel.getDynamicHeader(null);
assertNull("result", result);
}
use of org.jpos.iso.channel.BASE24Channel in project jPOS by jpos.
the class BaseChannelTest method testApplyOutgoingFiltersThrowsVetoException.
@Test
public void testApplyOutgoingFiltersThrowsVetoException() throws Throwable {
BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
bASE24Channel.addFilter(new MD5Filter(), 0);
try {
bASE24Channel.applyOutgoingFilters(new ISOMsg(), new LogEvent());
fail("Expected VetoException to be thrown");
} catch (ISOFilter.VetoException ex) {
assertEquals("ex.getMessage()", "MD5Filter not configured", ex.getMessage());
assertNull("ex.nested", ex.nested);
}
}
use of org.jpos.iso.channel.BASE24Channel in project jPOS by jpos.
the class BaseChannelTest method testAddFilter4.
@Test
public void testAddFilter4() throws Throwable {
BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
bASE24Channel.addFilter(new MD5Filter(), 0);
assertEquals("(BASE24Channel) bASE24Channel.incomingFilters.size()", 1, ((BASE24Channel) bASE24Channel).incomingFilters.size());
assertEquals("(BASE24Channel) bASE24Channel.outgoingFilters.size()", 1, ((BASE24Channel) bASE24Channel).outgoingFilters.size());
}
Aggregations