Package org.jpos.iso.packager

Examples of org.jpos.iso.packager.Base1SubFieldPackager


  statefulFilter.setMatchDirection(0);
  statefulFilter.setSavedFields((int[]) null);
  ISOMsg m = new ISOMsg("testStatefulFilterMti");
  ISOMsg result = statefulFilter.filter(
    new PADChannel(new XMLPackager()), m, new LogEvent(
      new Base1SubFieldPackager(), "testStatefulFilterTag"));
  assertSame("result", m, result);
    }
View Full Code Here


    }

    @Test
    public void testIsConnectedThrowsIllegalArgumentException() throws Throwable {
        ChannelPool channelPool = new ChannelPool();
        channelPool.addChannel(new GZIPChannel("testChannelPoolHost", -1, new Base1SubFieldPackager()));
        try {
            channelPool.isConnected();
            fail("Expected IllegalArgumentException to be thrown");
        } catch (IllegalArgumentException ex) {
            assertEquals("ex.getMessage()", "port out of range:-1", ex.getMessage());
View Full Code Here

    }

    @Test
    public void testSendThrowsIllegalArgumentException() throws Throwable {
        ChannelPool channelPool = new ChannelPool();
        channelPool.addChannel(new GZIPChannel("testChannelPoolHost", -1, new Base1SubFieldPackager()));
        try {
            channelPool.send((ISOMsg) new ISOMsg().clone());
            fail("Expected IllegalArgumentException to be thrown");
        } catch (IllegalArgumentException ex) {
            assertEquals("ex.getMessage()", "port out of range:-1", ex.getMessage());
View Full Code Here

    }

    @Test
    public void testSetPackager() throws Throwable {
        ChannelPool channelPool = new ChannelPool();
        channelPool.setPackager(new Base1SubFieldPackager());
        assertEquals("channelPool.getName()", "", channelPool.getName());
    }
View Full Code Here

        assertEquals("bASE24Channel.getHost()", "testBASE24ChannelHost", bASE24Channel.getHost());
    }

    @Test
    public void testConstructor3() throws Throwable {
        ISOPackager p = new Base1SubFieldPackager();
        ServerSocket serverSocket = new ServerSocket();
        BASE24Channel bASE24Channel = new BASE24Channel(p, serverSocket);
        assertEquals("bASE24Channel.getIncomingFilters().size()", 0, bASE24Channel.getIncomingFilters().size());
        assertEquals("bASE24Channel.getMaxPacketLength()", 100000, bASE24Channel.getMaxPacketLength());
        assertSame("bASE24Channel.getPackager()", p, bASE24Channel.getPackager());
View Full Code Here

        assertNull("vAPChannel.getHost()", vAPChannel.getHost());
    }

    @Test
    public void testSetConfiguration1() throws Throwable {
        VAPChannel vAPChannel = new VAPChannel(new Base1SubFieldPackager());
        vAPChannel.setConfiguration(new SimpleConfiguration());
        assertEquals("vAPChannel.srcid", "000000", vAPChannel.srcid);
        assertEquals("vAPChannel.dstid", "000000", vAPChannel.dstid);
        assertEquals("vAPChannel.getMaxPacketLength()", 100000, vAPChannel.getMaxPacketLength());
        assertEquals("vAPChannel.getPort()", 0, vAPChannel.getPort());
View Full Code Here

    @Test
    public void testFilter() throws Throwable {
        DelayFilter delayFilter = new DelayFilter(0);
        LogEvent evt = new LogEvent("testDelayFilterTag", "testString");
        ISOChannel channel = new CSChannel(new Base1SubFieldPackager(), new ServerSocket());
        ISOMsg result = delayFilter.filter(channel, m, evt);
        assertEquals("evt.payLoad.size()", 2, evt.getPayLoad().size());
        assertEquals("evt.payLoad.get(1)", "<delay-filter delay=\"0\"/>", evt.getPayLoad().get(1));
        assertSame("result", m, result);
    }
View Full Code Here

        assertSame("result", m, result);
    }

    @Test
    public void testFilter1() throws Throwable {
        LogEvent evt = new LogEvent(new BASE24TCPChannel("testDelayFilterHost", 100, new Base1SubFieldPackager()),
                "testDelayFilterTag", null);
        ISOMsg result = new DelayFilter(1).filter(new PADChannel(), null, evt);
        assertEquals("evt.payLoad.size()", 2, evt.getPayLoad().size());
        assertEquals("evt.payLoad.get(1)", "<delay-filter delay=\"1\"/>", evt.getPayLoad().get(1));
        assertNull("result", result);
View Full Code Here

        }
    }

    @Test
    public void testSendMessageLengthThrowsNullPointerException1() throws Throwable {
        ASCIIChannel aSCIIChannel = new ASCIIChannel(new Base1SubFieldPackager());
        try {
            aSCIIChannel.sendMessageLength(9998);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
View Full Code Here

TOP

Related Classes of org.jpos.iso.packager.Base1SubFieldPackager

Copyright © 2018 www.massapicom. 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.