use of org.jpos.core.Configuration in project jPOS by jpos.
the class TEST01001Test method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
TEST0100 tEST0100 = new TEST0100();
Configuration cfg = new SubConfiguration();
try {
tEST0100.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class DailyTaskAdaptorTest method testRunThrowsNumberFormatException.
@Test
public void testRunThrowsNumberFormatException() throws Throwable {
Configuration cfg = new SimpleConfiguration();
DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor();
dailyTaskAdaptor.setState(2);
dailyTaskAdaptor.setConfiguration(cfg);
try {
dailyTaskAdaptor.run();
fail("Expected NumberFormatException to be thrown");
} catch (NumberFormatException ex) {
assertEquals("ex.getMessage()", "For input string: \":0\"", ex.getMessage());
assertSame("dailyTaskAdaptor.getConfiguration()", cfg, dailyTaskAdaptor.getConfiguration());
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class DailyTaskAdaptorTest method testGetWhenThrowsNumberFormatException.
@Test
public void testGetWhenThrowsNumberFormatException() throws Throwable {
Configuration cfg = new SimpleConfiguration();
DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor();
dailyTaskAdaptor.setConfiguration(cfg);
try {
dailyTaskAdaptor.getWhen();
fail("Expected NumberFormatException to be thrown");
} catch (NumberFormatException ex) {
assertEquals("ex.getMessage()", "For input string: \":0\"", ex.getMessage());
assertSame("dailyTaskAdaptor.getConfiguration()", cfg, dailyTaskAdaptor.getConfiguration());
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class ChannelPoolTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Throwable {
ChannelPool channelPool = new ChannelPool();
Configuration cfg = new SimpleConfiguration();
channelPool.setConfiguration(cfg);
assertSame("channelPool.cfg", cfg, channelPool.cfg);
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class ChannelPoolTest method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
ChannelPool channelPool = new ChannelPool();
Configuration cfg = new SubConfiguration();
try {
channelPool.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertSame("channelPool.cfg", cfg, channelPool.cfg);
assertNull("ex.getMessage()", ex.getMessage());
assertEquals("channelPool.pool.size()", 0, channelPool.pool.size());
}
}
Aggregations