use of org.jpos.core.Configuration in project jPOS by jpos.
the class BSHLogListenerTest method testLog.
@Test
public void testLog() throws Throwable {
BSHLogListener bSHLogListener = new BSHLogListener();
Configuration cfg = new SimpleConfiguration(new Properties());
bSHLogListener.setConfiguration(cfg);
LogEvent ev = new LogEvent("testBSHLogListenerTag");
ev.setSource(new LogChannel());
LogEvent result = bSHLogListener.log(ev);
assertSame("result", ev, result);
assertSame("bSHLogListener.cfg", cfg, bSHLogListener.cfg);
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class BSHRequestListenerTest method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
BSHRequestListener bSHRequestListener = new BSHRequestListener();
Configuration cfg = new SubConfiguration();
try {
bSHRequestListener.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertSame("bSHRequestListener.cfg", cfg, bSHRequestListener.cfg);
assertNull("ex.getMessage()", ex.getMessage());
assertNull("bSHRequestListener.whitelist", bSHRequestListener.whitelist);
assertNull("bSHRequestListener.bshSource", bSHRequestListener.bshSource);
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class BaseChannelTest method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
BaseChannel x25Channel = new X25Channel();
Configuration cfg = new SimpleConfiguration((Properties) null);
try {
x25Channel.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertEquals("(X25Channel) x25Channel.getMaxPacketLength()", 100000, x25Channel.getMaxPacketLength());
assertEquals("(X25Channel) x25Channel.getPort()", 0, x25Channel.getPort());
assertEquals("(X25Channel) x25Channel.getTimeout()", 0, x25Channel.getTimeout());
assertNull("(X25Channel) x25Channel.getHost()", x25Channel.getHost());
assertNull("(X25Channel) x25Channel.getSocket()", x25Channel.getSocket());
assertFalse("(X25Channel) x25Channel.overrideHeader", ((X25Channel) x25Channel).overrideHeader);
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class BaseSMAdapterTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Throwable {
BaseSMAdapter baseSMAdapter = new BaseSMAdapter();
Configuration cfg = new SimpleConfiguration();
baseSMAdapter.setConfiguration(cfg);
assertSame("baseSMAdapter.cfg", cfg, baseSMAdapter.cfg);
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class JCESecurityModuleTest method testSetConfigurationThrowsConfigurationException.
@Test
public void testSetConfigurationThrowsConfigurationException() throws Throwable {
JCESecurityModule jCESecurityModule = new JCESecurityModule();
Configuration cfg = new SimpleConfiguration();
try {
jCESecurityModule.setConfiguration(cfg);
fail("Expected ConfigurationException to be thrown");
} catch (ConfigurationException ex) {
// expected
}
}
Aggregations