Package org.jpos.util

Examples of org.jpos.util.Logger


    }

    @Test
    public void testTranslatePINImplThrowsSMException1() throws Throwable {
        BaseSMAdapter baseSMAdapter = new BaseSMAdapter(new SubConfiguration(new SimpleConfiguration(new Properties(null)),
                "testBaseSMAdapterPrefix"), new Logger(), "testBaseSMAdapterRealm");
        try {
            baseSMAdapter.translatePINImpl(new EncryptedPIN(), new SecureDESKey((short) 100, "testBaseSMAdapterKeyType",
                    "testBaseSMAdapterKeyHexString1", "testBaseSMAdapterKeyCheckValueHexString1"), new SecureDESKey(), (byte) 0);
            fail("Expected SMException to be thrown");
        } catch (SMException ex) {
View Full Code Here


        }
    }

    @Test
    public void testGetLogger() throws Throwable {
        Logger logger = Logger.getLogger("testSimpleKeyFileName");
        SimpleKeyFile simpleKeyFile = new SimpleKeyFile();
        simpleKeyFile.setLogger(logger, "testSimpleKeyFileRealm");
        Logger result = simpleKeyFile.getLogger();
        assertSame("result", logger, result);
    }
View Full Code Here

        }
    }

    @Test
    public void testSetLogger() throws Throwable {
        Logger logger = Logger.getLogger("testSimpleKeyFileName");
        SimpleKeyFile simpleKeyFile = new SimpleKeyFile();
        simpleKeyFile.setLogger(logger, "testSimpleKeyFileRealm");
        assertSame("simpleKeyFile.logger", logger, simpleKeyFile.logger);
        assertEquals("simpleKeyFile.realm", "testSimpleKeyFileRealm", simpleKeyFile.realm);
    }
View Full Code Here

    }

    @Test
    public void testGetLogger() throws Throwable {
        Connector connector = new Connector();
        Logger logger = new Logger();
        connector.setLogger(logger, "testConnectorRealm");
        Logger result = connector.getLogger();
        assertSame("result", logger, result);
    }
View Full Code Here

    }

    @Test
    public void testSetLogger() throws Throwable {
        Connector connector = new Connector();
        Logger logger = new Logger();
        connector.setLogger(logger, "testConnectorRealm");
        assertSame("connector.getLogger()", logger, connector.getLogger());
        assertEquals("connector.getRealm()", "testConnectorRealm", connector.getRealm());
    }
View Full Code Here

        }
        for (int i = 1; i < args.length; i++)
        {
            try
            {
                Logger logger = (Logger) NameRegistrar.get("logger." + args[i]);
                logger.addListener(this);
            }
            catch (NameRegistrar.NotFoundException e)
            {
                cli.println("Logger " + args[i] + " not found -- ignored.");
            }
        }
        cli.getConsoleReader().readCharacter(new char[]{'q', 'Q'});
        for (int i = 1; i < args.length; i++)
        {
            try
            {
                Logger logger = (Logger) NameRegistrar.get("logger." + args[i]);
                logger.removeListener(this);
            }
            catch (NameRegistrar.NotFoundException e) { }
        }
    }
View Full Code Here

            String loggerName = e.getAttributeValue ("logger");
            if (loggerName != null) {
                String realm = e.getAttributeValue ("realm");
                if (realm == null)
                    realm = e.getName();
                Logger logger = Logger.getLogger (loggerName);
                ((LogSource)obj).setLogger (logger, realm);
            }
        }
    }
View Full Code Here

    }

    public void exec(PrintStream outPS,PrintStream errPS,String[] args)
    {
        JCESecurityModule sm = new JCESecurityModule();
        Logger logger = new Logger();
        logger.addListener(new SimpleLogListener(outPS));
        sm.setLogger(logger, "jce-security-module");
        Properties cfgProps = new Properties();
        SimpleConfiguration cfg = new SimpleConfiguration(cfgProps);
        String commandName = null;
        String[] commandParams = new String[10];                 // 10 is Maximum number of paramters for a command
View Full Code Here

    }

    @Test
    public void testSetLogger() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel();
        Logger logger = new Logger();
        gZIPChannel.setLogger(logger, "testBaseChannelRealm");
        assertSame("(GZIPChannel) gZIPChannel.logger", logger, ((GZIPChannel) gZIPChannel).logger);
        assertEquals("(GZIPChannel) gZIPChannel.originalRealm", "testBaseChannelRealm", ((GZIPChannel) gZIPChannel).originalRealm);
        assertEquals("(GZIPChannel) gZIPChannel.realm", "testBaseChannelRealm", ((GZIPChannel) gZIPChannel).realm);
    }
View Full Code Here

    }

    @Test
    public void testSetLogger1() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel();
        Logger logger = new Logger();
        gZIPChannel.setLogger(logger, "testBaseChannelRealm");
        gZIPChannel.setLogger(logger, "testBaseChannelRealm");
        assertSame("(GZIPChannel) gZIPChannel.logger", logger, ((GZIPChannel) gZIPChannel).logger);
        assertEquals("(GZIPChannel) gZIPChannel.realm", "testBaseChannelRealm", ((GZIPChannel) gZIPChannel).realm);
    }
View Full Code Here

TOP

Related Classes of org.jpos.util.Logger

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.