Search in sources :

Example 6 with BaseHeader

use of org.jpos.iso.header.BaseHeader in project jPOS by jpos.

the class BaseChannelTest method testGetDynamicHeader.

@Test
public void testGetDynamicHeader() throws Throwable {
    BaseChannel rawChannel = new RawChannel();
    byte[] image = new byte[2];
    BaseHeader result = (BaseHeader) rawChannel.getDynamicHeader(image);
    assertEquals(2, result.getLength(), "result.getLength()");
}
Also used : BaseHeader(org.jpos.iso.header.BaseHeader) RawChannel(org.jpos.iso.channel.RawChannel) Test(org.junit.jupiter.api.Test)

Example 7 with BaseHeader

use of org.jpos.iso.header.BaseHeader in project jPOS by jpos.

the class BaseChannelTest method testGetHeaderLength1.

@Test
public void testGetHeaderLength1() throws Throwable {
    BaseChannel logChannel = new LogChannel("testBaseChannelHost", 100, new GenericValidatingPackager());
    ISOMsg iSOVMsg = new ISOMsg();
    iSOVMsg.setHeader(new BaseHeader());
    int result = logChannel.getHeaderLength((ISOMsg) iSOVMsg.clone());
    assertEquals(0, result, "result");
}
Also used : GenericValidatingPackager(org.jpos.iso.packager.GenericValidatingPackager) LogChannel(org.jpos.iso.channel.LogChannel) BaseHeader(org.jpos.iso.header.BaseHeader) Test(org.junit.jupiter.api.Test)

Aggregations

BaseHeader (org.jpos.iso.header.BaseHeader)7 Test (org.junit.jupiter.api.Test)4 BigDecimal (java.math.BigDecimal)2 SAXException (org.xml.sax.SAXException)2 ObjectOutputStream (java.io.ObjectOutputStream)1 LogChannel (org.jpos.iso.channel.LogChannel)1 RawChannel (org.jpos.iso.channel.RawChannel)1 GenericValidatingPackager (org.jpos.iso.packager.GenericValidatingPackager)1 XMLPackager (org.jpos.iso.packager.XMLPackager)1