Package org.jpos.util

Examples of org.jpos.util.LogEvent


    @Override
    public SecureDESKey translateKeyFromOldLMK (SecureDESKey kd) throws SMException {
        SimpleMsg[] cmdParameters =  {
            new SimpleMsg("parameter", "Key under old LMK", kd)
        };
        LogEvent evt = new LogEvent(this, "s-m-operation");
        evt.addMessage(new SimpleMsg("command", "Translate Key from old to new LMK", cmdParameters));
        SecureDESKey result = null;
        try {
            result = translateKeyFromOldLMKImpl(kd);
            evt.addMessage(new SimpleMsg("result", "Translated Key under new LMK", result));
        } catch (Exception e) {
            evt.addMessage(e);
            throw  e instanceof SMException ? (SMException) e : new SMException(e);
        } finally {
            Logger.log(evt);
        }
        return  result;
View Full Code Here


    @Override
    public void eraseOldLMK () throws SMException {
        SimpleMsg[] cmdParameters =  {
        };
        LogEvent evt = new LogEvent(this, "s-m-operation");
        evt.addMessage(new SimpleMsg("command", "Erase the key change storage", cmdParameters));
        try {
            eraseOldLMKImpl();
        } catch (Exception e) {
            evt.addMessage(e);
            throw  e instanceof SMException ? (SMException) e : new SMException(e);
        } finally {
            Logger.log(evt);
        }
    }
View Full Code Here

    @Test
    public void testApplyIncomingFilters() throws Throwable {
        byte[] image = "testString".getBytes();
        final BaseChannel cSChannel = new CSChannel();
        cSChannel.addIncomingFilter(filter);
        final LogEvent evt = new LogEvent();
        byte[] header = new byte[2];
        when(filter.filter(cSChannel, m, evt)).thenReturn(m);
        ISOMsg result = cSChannel.applyIncomingFilters(m, header, image, evt);
        assertSame("result", m, result);
    }
View Full Code Here

    }

    @Test
    public void testApplyIncomingFilters1() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel("testBaseChannelHost", 100, new ISOBaseValidatingPackager());
        LogEvent evt = new LogEvent();
        byte[] header = new byte[0];
        byte[] image = new byte[2];
        ISOMsg result = gZIPChannel.applyIncomingFilters(m, header, image, evt);
        assertSame("result", m, result);
    }
View Full Code Here

    @Test
    public void testApplyIncomingFilters2() throws Throwable {
        BaseChannel x25Channel = new X25Channel(null, new ServerSocket());
        byte[] header = new byte[1];
        byte[] image = new byte[1];
        ISOMsg result = x25Channel.applyIncomingFilters(null, header, image, new LogEvent("testBaseChannelTag"));
        assertNull("result", result);
    }
View Full Code Here

    public void testApplyIncomingFiltersThrowsNullPointerException() throws Throwable {
        BaseChannel cSChannel = new CSChannel();
        cSChannel.addIncomingFilter(new MacroFilter());
        byte[] header = new byte[2];
        try {
            cSChannel.applyIncomingFilters(null, header, "testString".getBytes(), new LogEvent());
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
        }
    }
View Full Code Here

    @Test
    public void testApplyIncomingFiltersThrowsVetoException() throws Throwable {
        BaseChannel x25Channel = new X25Channel();
        x25Channel.addFilter(new MD5Filter());
        try {
            x25Channel.applyIncomingFilters(new ISOMsg(), new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag"));
            fail("Expected VetoException to be thrown");
        } catch (ISOFilter.VetoException ex) {
            assertEquals("ex.getMessage()", "MD5Filter not configured", ex.getMessage());
            assertNull("ex.nested", ex.nested);
        }
View Full Code Here

    }

    @Test
    public void testApplyOutgoingFilters() throws Throwable {
        BaseChannel x25Channel = new X25Channel();
        LogEvent evt = new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag");
        ISOMsg result = x25Channel.applyOutgoingFilters(m, evt);
        assertSame("result", m, result);
    }
View Full Code Here

    }

    @Test
    public void testApplyOutgoingFilters1() throws Throwable {
        BaseChannel x25Channel = new X25Channel();
        ISOMsg result = x25Channel.applyOutgoingFilters(null, new LogEvent(new CTCSubFieldPackager(), "testBaseChannelTag"));
        assertNull("result", result);
    }
View Full Code Here

    @Test
    public void testApplyOutgoingFiltersThrowsVetoException() throws Throwable {
        BaseChannel bASE24Channel = new BASE24Channel("testBaseChannelHost", 100, new ISO87APackagerBBitmap());
        bASE24Channel.addFilter(new MD5Filter(), 0);
        try {
            bASE24Channel.applyOutgoingFilters(new ISOMsg(), new LogEvent());
            fail("Expected VetoException to be thrown");
        } catch (ISOFilter.VetoException ex) {
            assertEquals("ex.getMessage()", "MD5Filter not configured", ex.getMessage());
            assertNull("ex.nested", ex.nested);
        }
View Full Code Here

TOP

Related Classes of org.jpos.util.LogEvent

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.