use of org.jpos.core.SubConfiguration in project jPOS by jpos.
the class FilterLogListenerTest method testSetConfigurationThrowsConfigurationException.
@Test
public void testSetConfigurationThrowsConfigurationException() throws Throwable {
FilterLogListener filterLogListener = new FilterLogListener(new PrintStream(new ByteArrayOutputStream()));
Configuration cfg = new SubConfiguration();
try {
filterLogListener.setConfiguration(cfg);
fail("Expected ConfigurationException to be thrown");
} catch (ConfigurationException ex) {
assertEquals("ex.getMessage()", "java.lang.NullPointerException", ex.getMessage());
assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
assertEquals("filterLogListener.getPriority()", "info", filterLogListener.getPriority());
}
}
use of org.jpos.core.SubConfiguration in project jPOS by jpos.
the class BaseSMAdapterTest method testTranslatePINImplThrowsSMException1.
@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) {
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.core.SubConfiguration 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.core.SubConfiguration 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.core.SubConfiguration in project jPOS by jpos.
the class ProtectedLogListenerTest method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
ProtectedLogListener protectedLogListener = new ProtectedLogListener();
Configuration cfg = new SubConfiguration();
try {
protectedLogListener.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertSame("protectedLogListener.cfg", cfg, protectedLogListener.cfg);
assertNull("ex.getMessage()", ex.getMessage());
assertNull("protectedLogListener.wipeFields", protectedLogListener.wipeFields);
assertNull("protectedLogListener.protectFields", protectedLogListener.protectFields);
}
}
Aggregations