Examples of BASE1Header


Examples of org.jpos.iso.header.BASE1Header

            return null;
        }
    }
   
    private static String stringify(byte[] headerBytes, String string) {
        BASE1Header base1Header = new BASE1Header();
        base1Header.unpack(headerBytes);
        return "\nHeader is rejected = [" + base1Header.isRejected() + "]";
    }
View Full Code Here

Examples of org.jpos.iso.header.BASE1Header

    @Test
    public void testSendMessageHeaderThrowsNullPointerException1() throws Throwable {
        byte[] TPDU = new byte[1];
        NCCChannel nCCChannel = new NCCChannel(new ISO87BPackager(), TPDU, new ServerSocket());
        ISOMsg m = new ISOMsg(100);
        m.setHeader(new BASE1Header("testNCCChannelSource", "testNCCChannelDestination"));
        try {
            nCCChannel.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.BASE1Header

        return h.isRejected() || (h.getHLen() != BASE1Header.LENGTH);
    }

    protected boolean shouldIgnore (byte[] b) {
        if (b != null) {
            BASE1Header h = new BASE1Header(b);
            return h.getFormat() > 2;
        }
        return false;
    }
View Full Code Here

Examples of org.jpos.iso.header.BASE1Header

     * @see ISOChannel#send
     */
    public void send (ISOMsg m) throws IOException, ISOException
    {
        if (m.isIncoming() && m.getHeader() != null) {
            BASE1Header h = new BASE1Header(m.getHeader());
            h.swapDirection();
        }
        super.send(m);
    }
View Full Code Here

Examples of org.jpos.iso.header.BASE1Header

    @Test
    public void testGetDynamicHeader() throws Throwable {
        VAPChannel vAPChannel = new VAPChannel();
        byte[] image = new byte[0];
        BASE1Header result = (BASE1Header) vAPChannel.getDynamicHeader(image);
        assertNotNull(result);
        assertTrue("Test completed without Exception", true);
    }
View Full Code Here

Examples of org.jpos.iso.header.BASE1Header

    @Test
    public void testSendMessageHeaderThrowsArrayIndexOutOfBoundsException() throws Throwable {
        VAPChannel vAPChannel = new VAPChannel();
        final byte[] image = new byte[2];
        VAPChannel vAPChannel2 = new VAPChannel(new ISO87BPackager());
        final BASE1Header dynamicHeader = (BASE1Header) vAPChannel2.getDynamicHeader(image);

        given(m.getHeader()).willReturn(image);
        given(m.getISOHeader()).willReturn(dynamicHeader);

        try {
View Full Code Here

Examples of org.jpos.iso.header.BASE1Header

    }

    @Test
    public void testClone() throws Throwable {
        byte[] header = new byte[2];
        ISOHeader header2 = new BASE1Header(header);
        ISOMsg iSOMsg = new ISOMsg();
        iSOMsg.setHeader(header2);
        ISOMsg result = (ISOMsg) iSOMsg.clone();
        assertEquals("result.getDirection()", 0, result.getDirection());
        assertEquals("iSOMsg.fields.size()", 0, iSOMsg.fields.size());
View Full Code Here

Examples of org.jpos.iso.header.BASE1Header

    }

    @Test
    public void testGetHeader() throws Throwable {
        byte[] header = new byte[2];
        ISOHeader header2 = new BASE1Header(header);
        ISOMsg iSOMsg = new ISOMsg();
        iSOMsg.setHeader(header2);
        byte[] result = iSOMsg.getHeader();
        assertSame("result", header, result);
        assertEquals("header[0]", (byte) 0, header[0]);
View Full Code Here

Examples of org.jpos.iso.header.BASE1Header

    }

    @Test
    public void testGetISOHeader() throws Throwable {
        byte[] header = new byte[2];
        ISOHeader header2 = new BASE1Header(header);
        ISOMsg iSOMsg = new ISOMsg();
        iSOMsg.setHeader(header2);
        ISOHeader result = iSOMsg.getISOHeader();
        assertSame("result", header2, result);
    }
View Full Code Here

Examples of org.jpos.iso.header.BASE1Header

    }

    @Test
    public void testSetHeader() throws Throwable {
        byte[] header = new byte[2];
        ISOHeader header2 = new BASE1Header(header);
        ISOMsg iSOMsg = new ISOMsg();
        iSOMsg.setHeader(header2);
        assertSame("iSOMsg.header", header2, 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.