Search in sources :

Example 16 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class BaseSMAdapterTest method testGetLogger.

@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);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 17 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class BaseSMAdapterTest method testConstructor.

@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);
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) SubConfiguration(org.jpos.core.SubConfiguration) Properties(java.util.Properties) Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 18 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class BaseSMAdapterTest method testImportPINImplThrowsSMException1.

@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");
    } catch (SMException ex) {
        assertEquals("ex.getMessage()", "Operation not supported in: org.jpos.security.BaseSMAdapter", ex.getMessage());
        assertNull("ex.nested", ex.nested);
        assertNull("ex.getNested()", ex.getNested());
    }
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) SubConfiguration(org.jpos.core.SubConfiguration) Properties(java.util.Properties) Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 19 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class BaseSMAdapterTest method testSetLogger.

@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);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 20 with Logger

use of org.jpos.util.Logger in project jPOS by jpos.

the class SimpleKeyFileTest method testSetLogger.

@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);
}
Also used : Logger(org.jpos.util.Logger) Test(org.junit.Test)

Aggregations

Logger (org.jpos.util.Logger)45 Test (org.junit.Test)36 SimpleConfiguration (org.jpos.core.SimpleConfiguration)7 SubConfiguration (org.jpos.core.SubConfiguration)5 ISOMsg (org.jpos.iso.ISOMsg)5 SimpleLogListener (org.jpos.util.SimpleLogListener)5 Properties (java.util.Properties)4 Configuration (org.jpos.core.Configuration)4 ISOFieldPackager (org.jpos.iso.ISOFieldPackager)4 ISOException (org.jpos.iso.ISOException)3 ConfigurationException (org.jpos.core.ConfigurationException)2 GZIPChannel (org.jpos.iso.channel.GZIPChannel)2 Log (org.jpos.util.Log)2 NameRegistrar (org.jpos.util.NameRegistrar)2 Before (org.junit.Before)2 PrintStream (java.io.PrintStream)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1 IFA_LLLLCHAR (org.jpos.iso.IFA_LLLLCHAR)1 IFE_CHAR (org.jpos.iso.IFE_CHAR)1