Package org.jpos.iso.channel

Examples of org.jpos.iso.channel.LogChannel


    public void testLog() throws Throwable {
        BSHLogListener bSHLogListener = new BSHLogListener();
        Configuration cfg = new SimpleConfiguration(new Properties());
        bSHLogListener.setConfiguration(cfg);
        LogEvent ev = new LogEvent("testBSHLogListenerTag");
        ev.setSource(new LogChannel());
        LogEvent result = bSHLogListener.log(ev);
        assertSame("result", ev, result);
        assertSame("bSHLogListener.cfg", cfg, bSHLogListener.cfg);
    }
View Full Code Here


    @Test
    public void testProcess2() throws Throwable {
        BSHRequestListener bSHRequestListener = new BSHRequestListener();
        ISOMsg m = new ISOMsg();
        m.setMTI("testBSHRequestListenerMti");
        boolean result = bSHRequestListener.process(new LogChannel(), m);
        assertFalse("result", result);
        assertNull("bSHRequestListener.whitelist", bSHRequestListener.whitelist);
    }
View Full Code Here

  StatefulFilter statefulFilter = new StatefulFilter();
  statefulFilter.setConfiguration(new SimpleConfiguration());
  statefulFilter.setSavedFields((int[]) null);
  ISOMsg m = new ISOMsg("testStatefulFilterMti");
  m.setDirection(1);
  ISOMsg result = statefulFilter.filter(new LogChannel(), m,
    new LogEvent("testStatefulFilterTag", new Object()));
  assertSame("result", m, result);
    }
View Full Code Here

    }

    @Test
    public void testSetSource() throws Throwable {
        ISOMsg iSOMsg = new ISOMsg();
        ISOSource source = new LogChannel("testISOMsgHost", 100, new ISO87APackager());
        iSOMsg.setSource(source);
        assertSame("iSOMsg.getSource()", source, iSOMsg.getSource());
    }
View Full Code Here

        assertEquals("result", 0, result);
    }

    @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

        assertEquals("result", 1, result);
    }

    @Test
    public void testGetHeaderLengthThrowsNullPointerException() throws Throwable {
        BaseChannel logChannel = new LogChannel("testBaseChannelHost", 100, new GenericValidatingPackager());
        try {
            logChannel.getHeaderLength((ISOMsg) null);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
        }
    }
View Full Code Here

        assertEquals("m.getDirection()", 0, m.getDirection());
    }

    @Test
    public void testSendMessageHeaderThrowsNullPointerException() throws Throwable {
        BaseChannel logChannel = new LogChannel();
        byte[] header = new byte[1];
        logChannel.setOverrideHeader(true);
        logChannel.setHeader(header);
        ISOMsg m = new ISOMsg();
        try {
            logChannel.sendMessageHeader(m, 100);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertNull("(LogChannel) logChannel.serverOut", ((LogChannel) logChannel).serverOut);
            assertEquals("m.getDirection()", 0, m.getDirection());
View Full Code Here

        assertEquals("(XMLChannel) xMLChannel.getHeaderLength()", 0, actual);
    }

    @Test
    public void testSendMessageThrowsNullPointerException() throws Throwable {
        BaseChannel logChannel = new LogChannel();
        byte[] b = new byte[3];
        try {
            logChannel.sendMessage(b, 100, 1000);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
            assertNull("(LogChannel) logChannel.serverOut", ((LogChannel) logChannel).serverOut);
        }
View Full Code Here

TOP

Related Classes of org.jpos.iso.channel.LogChannel

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.