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");
}
use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class QMUXTest method testInitServiceWithoutListeners.
@Test
public void testInitServiceWithoutListeners() throws Throwable {
QMUX mux = new QMUX();
Configuration cfg = new SimpleConfiguration();
mux.setConfiguration(cfg);
Element persist = new Element("testQMUXName");
persist.addContent(new Element("in").addContent("queue-in"));
persist.addContent(new Element("out").addContent("queue-out"));
persist.addContent(new Element("unhandled").addContent("queue-unhandled"));
persist.addContent(new Element("ready").addContent("test-ready"));
persist.addContent(new Element("unhandled").addContent("queue-unhandled"));
mux.setPersist(persist);
mux.initService();
assertEquals("queue-unhandled", mux.unhandled);
assertEquals("queue-out", mux.out);
assertEquals("queue-in", mux.in);
assertNull(mux.ignorerc);
assertNotNull(mux.sp);
assertFalse(mux.isModified());
assertArrayEquals(new String[] { "test-ready" }, mux.ready);
assertArrayEquals(new String[] { "41", "11" }, mux.key);
assertEquals(0, mux.listeners.size());
}
use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class TransactionManagerTest method testInitServiceThrowsConfigurationException.
@Test
public void testInitServiceThrowsConfigurationException() throws Throwable {
Configuration cfg = new SimpleConfiguration();
transactionManager.setConfiguration(cfg);
try {
transactionManager.initService();
fail("Expected ConfigurationException to be thrown");
} catch (ConfigurationException ex) {
assertEquals("queue property not specified", ex.getMessage(), "ex.getMessage()");
assertNull(ex.getNested(), "ex.getNested()");
assertNull(transactionManager.queue, "transactionManager.queue");
assertSame(cfg, transactionManager.getConfiguration(), "transactionManager.getConfiguration()");
assertEquals(0L, transactionManager.tail, "transactionManager.tail");
assertTrue(transactionManager.isModified(), "transactionManager.isModified()");
assertNull(transactionManager.sp, "transactionManager.sp");
assertNull(transactionManager.psp, "transactionManager.psp");
assertEquals(0L, transactionManager.head, "transactionManager.head");
assertNull(transactionManager.groups, "transactionManager.groups");
assertNull(transactionManager.tailLock, "transactionManager.tailLock");
}
}
use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.
the class CheckFieldsTest method setUp.
@BeforeEach
public void setUp() {
cfg = new SimpleConfiguration();
cf = new CheckFields();
cf.setConfiguration(cfg);
}
Aggregations