Package org.jpos.util

Examples of org.jpos.util.Logger


        assertThat(iSOBasePackager.getHeaderLength(), is(9876));
    }

    @Test
    public void testGetLogger() {
        Logger logger = mock(Logger.class);
        iSOBasePackager.setLogger(logger, "testRealm");
        assertThat(iSOBasePackager.getLogger(), is(logger));
    }
View Full Code Here


        assertThat(iSOBasePackager.getLogger(), is(logger));
    }

    @Test
    public void testGetRealm() {
        Logger logger = mock(Logger.class);
        iSOBasePackager.setLogger(logger, "testRealm");
        assertThat(iSOBasePackager.getRealm(), is("testRealm"));
    }
View Full Code Here

    @Test
    public void testConstructorThrowsConfigurationException1() throws Throwable {
        Configuration cfg = new SimpleConfiguration();
        try {
            new JCESecurityModule(cfg, new Logger(), "testJCESecurityModuleRealm");
            fail("Expected ConfigurationException to be thrown");
        } catch (ConfigurationException ex) {
            // expected
        }
    }
View Full Code Here

    @Test
    public void testConstructorThrowsNullPointerException2() throws Throwable {
        Configuration cfg = new SubConfiguration();
        try {
            new JCESecurityModule(cfg, new Logger(), "testJCESecurityModuleRealm");
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
        }
    }
View Full Code Here

        sm.setConfiguration(new SimpleConfiguration(props));
    }

    private void initLogger()
    {
        Logger logger = new Logger();
        logger.addListener(new SimpleLogListener());
        log = new Log(logger, "SM Test");
    }
View Full Code Here

public class BaseSMAdapterTest {

    @Test
    public void testConstructor() throws Throwable {
        Configuration cfg = new SubConfiguration(new SimpleConfiguration(new Properties(null)), "testBaseSMAdapterPrefix");
        Logger logger = new Logger();
        BaseSMAdapter baseSMAdapter = new BaseSMAdapter(cfg, logger, "testBaseSMAdapterRealm");
        assertSame("baseSMAdapter.cfg", cfg, baseSMAdapter.cfg);
        assertEquals("baseSMAdapter.realm", "testBaseSMAdapterRealm", baseSMAdapter.realm);
        assertSame("baseSMAdapter.logger", logger, baseSMAdapter.logger);
    }
View Full Code Here

    }

    @Test
    public void testGetLogger() throws Throwable {
        BaseSMAdapter baseSMAdapter = new BaseSMAdapter();
        Logger logger = Logger.getLogger("testBaseSMAdapterName");
        baseSMAdapter.setLogger(logger, "testBaseSMAdapterRealm");
        Logger result = baseSMAdapter.getLogger();
        assertSame("result", logger, result);
    }
View Full Code Here

    }

    @Test
    public void testGetRealm() throws Throwable {
        BaseSMAdapter jCESecurityModule = new BaseSMAdapter();
        jCESecurityModule.setLogger(new Logger(), "testBaseSMAdapterRealm");
        String result = jCESecurityModule.getRealm();
        assertEquals("result", "testBaseSMAdapterRealm", result);
    }
View Full Code Here

    }

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

    }

    @Test
    public void testSetLogger() throws Throwable {
        BaseSMAdapter baseSMAdapter = new BaseSMAdapter();
        Logger logger = Logger.getLogger("testBaseSMAdapterName");
        baseSMAdapter.setLogger(logger, "testBaseSMAdapterRealm");
        assertSame("baseSMAdapter.logger", logger, baseSMAdapter.logger);
        assertEquals("baseSMAdapter.realm", "testBaseSMAdapterRealm", baseSMAdapter.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.