use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class RemoveNewLinesMapperTest method testValuesChangedByConfiguration.
@Test
void testValuesChangedByConfiguration() throws ConfigurationException {
RemoveNewLinesMapper mapper = new RemoveNewLinesMapper();
SimpleConfiguration cfg = new SimpleConfiguration();
cfg.put("combine-spaces", "true");
cfg.put("newline-at-end", "false");
mapper.setConfiguration(cfg);
assertTrue(mapper.combineSpaces);
assertFalse(mapper.newLineAtEnd);
}
use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class ProtectedLogListenerTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Throwable {
ProtectedLogListener protectedLogListener = new ProtectedLogListener();
Configuration cfg = new SimpleConfiguration();
protectedLogListener.setConfiguration(cfg);
assertEquals(0, protectedLogListener.protectFields.length, "protectedLogListener.protectFields.length");
assertEquals(0, protectedLogListener.wipeFields.length, "protectedLogListener.wipeFields.length");
assertSame(cfg, protectedLogListener.cfg, "protectedLogListener.cfg");
}
use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class DailyTaskAdaptorTest method testWaitUntilStartTimeThrowsNumberFormatException.
@Test
public void testWaitUntilStartTimeThrowsNumberFormatException() throws Throwable {
DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor();
Configuration cfg = new SimpleConfiguration();
dailyTaskAdaptor.setConfiguration(cfg);
try {
dailyTaskAdaptor.waitUntilStartTime();
fail("Expected NumberFormatException to be thrown");
} catch (NumberFormatException ex) {
assertEquals("For input string: \":0\"", ex.getMessage(), "ex.getMessage()");
assertSame(cfg, dailyTaskAdaptor.getConfiguration(), "dailyTaskAdaptor.getConfiguration()");
}
}
use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class CMFTest method testCMFConverterOverride.
@Test
public void testCMFConverterOverride() throws ConfigurationException {
CMFConverter c = new CMFConverter();
SimpleConfiguration cfg = new SimpleConfiguration();
cfg.put("10000", "----,jPOS error message");
c.setConfiguration(cfg);
assertEquals(new SimpleRC("0000", "APPROVED"), c.convert(CMF.APPROVED), "Standard RC");
assertEquals(new SimpleRC("ZZZZ", "General decline"), c.convert(CMF.GENERAL_DECLINE), "ResourceBundle override");
assertEquals(new SimpleRC("9999", "Internal error"), c.convert(CMF.INTERNAL_ERROR), "ResourceBundle override");
assertEquals(new SimpleRC("----", "jPOS error message"), c.convert(CMF.JPOS), "Configuration override");
}
use of org.jpos.core.SimpleConfiguration 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(cfg, baseSMAdapter.cfg, "baseSMAdapter.cfg");
}
Aggregations