Examples of BaseHeader


Examples of org.jpos.iso.header.BaseHeader

    /**
     * Sets an optional message header image
     * @param b header image
     */
    public void setHeader(byte[] b) {
        header = new BaseHeader (b);
    }
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

                    ic = new ISOField (fieldNumber, value);
                }
                m.set (ic);
                stk.push (ic);
            } else if (HEADER_TAG.equals (name)) {
                BaseHeader bh = new BaseHeader();
                bh.setAsciiEncoding (ASCII_ENCODING.equalsIgnoreCase(atts.getValue(ENCODING_ATTR)));
                stk.push (bh);
            }
        } catch (ISOException e) {
            throw new SAXException
                ("ISOException unpacking "+fieldNumber);
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

                    // giving up
                }
            }
        }
        else if (obj instanceof BaseHeader) {
            BaseHeader bh = (BaseHeader) obj;
            String s = new String(ch,start,length);
            if (bh.isAsciiEncoding()) {
                bh.unpack (s.getBytes());
            } else {
                bh.unpack (ISOUtil.hex2byte (s));
            }
        }
    }
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

            if (stk.empty())
                stk.push (m); // push outter message
        } else if (ISOFIELD_TAG.equals (name)) {
            stk.pop();
        } else if (HEADER_TAG.equals (name)) {
            BaseHeader h = (BaseHeader) stk.pop();
            ISOMsg m = (ISOMsg) stk.peek ();
            m.setHeader (h);
        }
    }
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

                else {
                    m.set (new ISOField (fieldNumber, value));
                }
               
            } else if (HEADER_TAG.equals (name)) {
                stk.push (new BaseHeader());
            }
        } catch (ISOException e) {
            throw new SAXException
                ("ISOException unpacking "+fieldNumber);
        }
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

        if (name.equals (ISOMSG_TAG)) {
            ISOMsg m = (ISOMsg) stk.pop();
            if (stk.empty())
                stk.push (m); // push outter message
        } else if (HEADER_TAG.equals (name)) {
            BaseHeader h = (BaseHeader) stk.pop();
            ISOMsg m = (ISOMsg) stk.peek ();
            m.setHeader (h);
        }
    }
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

    @Test
    public void testGetDynamicHeader() throws Throwable {
        BaseChannel rawChannel = new RawChannel();
        byte[] image = new byte[2];
        BaseHeader result = (BaseHeader) rawChannel.getDynamicHeader(image);
        assertEquals("result.getLength()", 2, result.getLength());
    }
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

    @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("result", 0, result);
    }
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

    @Test
    public void testSendMessageHeaderThrowsNullPointerException2() throws Throwable {
        VAPChannel vAPChannel = new VAPChannel("testVAPChannelHost", 100, new XMLPackager());
        ISOMsg m = new ISOMsg("testVAPChannelMti");
        m.setHeader(new BaseHeader());
        try {
            vAPChannel.sendMessageHeader(m, 100);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
View Full Code Here

Examples of org.jpos.iso.header.BaseHeader

    }

    @Test
    public void testWriteHeader1() throws Throwable {
        ISOMsg iSOMsg = new ISOMsg("testISOMsgMti");
        final BaseHeader header = mock(BaseHeader.class);
        iSOMsg.setHeader(header);
        ObjectOutputStream out = mock(ObjectOutputStream.class);
        given(header.getLength()).willReturn(0);
        iSOMsg.writeHeader(out);
        assertSame("iSOMsg.header", header, iSOMsg.header);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.