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);
}
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);
}
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());
}
}
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);
}
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);
}
Aggregations