Examples of ISOMsg


Examples of org.jpos.iso.ISOMsg

  public void messageProcessTC(IMessage message) {
    try {
      if (nacChannel.isConnected()) {
        nacChannel.send((ISOMsg) message);

        ISOMsg msg = nacChannel.receive();
        if (msg != null) {
          ISOJPOSMessage response = new ISOJPOSMessage(msg);
          messageProcessTM(response);
        }
      }
View Full Code Here

Examples of org.jpos.iso.ISOMsg

        assertNull (sp.rdp ("PUT"));
    }
    public void testPersistentContext() throws Exception {
        Context ctx = new Context();
        ctx.put("P", "ABC", true);
        ISOMsg m = new ISOMsg("0800");
        m.set(11, "000001");
        ctx.put("ISOMSG", m, true);
        sp.out("CTX", ctx);
        assertNotNull("entry should not be null", sp.in("CTX"));
    }
View Full Code Here

Examples of org.jpos.iso.ISOMsg

    @Test
    public void testProcess() throws Throwable {
        BSHRequestListener bSHRequestListener = new BSHRequestListener();
        bSHRequestListener.setConfiguration(new SimpleConfiguration());
        boolean result = bSHRequestListener.process(new PostChannel(), new ISOMsg("testBSHRequestListenerMti"));
        assertTrue("result", result);
        assertEquals("bSHRequestListener.whitelist.size()", 1, bSHRequestListener.whitelist.size());
    }
View Full Code Here

Examples of org.jpos.iso.ISOMsg

    }

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

Examples of org.jpos.iso.ISOMsg

    }

    @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

Examples of org.jpos.iso.ISOMsg

            b.append(m.getString(aKey));
        }
        String skey = b.toString();
        if(m.getDirection() == getMatchDirection()){
            int[] savedFields = getSavedFields();
            ISOMsg saved = (ISOMsg)(
                (savedFields != null && savedFields.length != 0) ?
                    m.clone(savedFields) : m.clone());
            int[] ignoredFields = getIgnoredFields();
            if (ignoredFields != null) saved.unset(ignoredFields);
            getSpace().out(skey, saved, getTimeout());
            return m;
        } else {
            ISOMsg saved = (ISOMsg)getSpace().inp(skey);
            if (saved == null && isVetoUnmatched())
                throw new VetoException("unmatched iso message");
            else if(saved != null) {
                if (!isOverwriteOriginalFields()) m.merge(saved);
                else {
                    saved.merge(m);
                    m = saved;
                }
            }
            return m;
        }
View Full Code Here

Examples of org.jpos.iso.ISOMsg

    public void testFilter() throws Throwable {
        MacroFilter macroFilter = new MacroFilter();
        ISOChannel channel = new GZIPChannel(new X92GenericPackager());
        LogEvent evt = new LogEvent("testMacroFilterTag", "\u0000\u0000");
        when(m.getMaxField()).thenReturn(0);
        ISOMsg result = macroFilter.filter(channel, m, evt);
        assertSame("result", m, result);
        verify(m).hasField(0);
    }
View Full Code Here

Examples of org.jpos.iso.ISOMsg

        verify(m).hasField(0);
    }

    @Test
    public void testFilter1() throws Throwable {
        ISOMsg m = new ISOMsg(100);
        m.merge(new ISOMsg("testMacroFilterMti"));
        m.set(1, "");
        ISOMsg result = new MacroFilter().filter(new CSChannel(new ISOBaseValidatingPackager()), m, new LogEvent(
                "testMacroFilterTag", ""));
        assertEquals("result.getDirection()", 0, result.getDirection());
    }
View Full Code Here

Examples of org.jpos.iso.ISOMsg

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

    @Test
    public void testFilter2() throws Throwable {
        ISOMsg m = new ISOMsg();
        m.set(100, "testMacroFilterValue");
        ISOMsg result = new MacroFilter().filter(new BASE24TCPChannel(), m, new LogEvent("testMacroFilterTag"));
        assertSame("result", m, result);
    }
View Full Code Here

Examples of org.jpos.iso.ISOMsg

        ISOChannel channel = new PADChannel(new GenericSubFieldPackager());
        LogEvent evt = new LogEvent();
        when(m.getMaxField()).thenReturn(0);
        when(m.hasField(0)).thenReturn(false);

        ISOMsg result = macroFilter.filter(channel, m, evt);
        assertSame("result", m, result);
    }
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.