Search in sources :

Example 26 with SimpleConfiguration

use of org.jpos.core.SimpleConfiguration 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(cfg, channelPool.cfg, "channelPool.cfg");
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.jupiter.api.Test)

Example 27 with SimpleConfiguration

use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.

the class TransactionManagerTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    Configuration cfg = new SimpleConfiguration();
    transactionManager.setConfiguration(cfg);
    assertTrue(transactionManager.debug, "transactionManager.debug");
    assertSame(cfg, transactionManager.getConfiguration(), "transactionManager.getConfiguration()");
    assertEquals(0L, transactionManager.pauseTimeout, "transactionManager.pauseTimeout");
    assertEquals(5000L, transactionManager.retryInterval, "transactionManager.retryInterval");
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.jupiter.api.Test)

Example 28 with SimpleConfiguration

use of org.jpos.core.SimpleConfiguration in project jPOS by jpos.

the class QueryHostTest method setUp.

@BeforeEach
public void setUp() throws Exception {
    cfg = new SimpleConfiguration();
    queryHost = new QueryHost();
    queryHost.setConfiguration(cfg);
    NameRegistrar.register("mux.TEST", this);
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 29 with SimpleConfiguration

use of org.jpos.core.SimpleConfiguration 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("For input string: \":0\"", ex.getMessage(), "ex.getMessage()");
        assertSame(cfg, dailyTaskAdaptor.getConfiguration(), "dailyTaskAdaptor.getConfiguration()");
    }
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.jupiter.api.Test)

Example 30 with SimpleConfiguration

use of org.jpos.core.SimpleConfiguration 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("For input string: \":0\"", ex.getMessage(), "ex.getMessage()");
        assertSame(cfg, dailyTaskAdaptor.getConfiguration(), "dailyTaskAdaptor.getConfiguration()");
    }
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

SimpleConfiguration (org.jpos.core.SimpleConfiguration)71 Test (org.junit.jupiter.api.Test)59 Configuration (org.jpos.core.Configuration)25 Properties (java.util.Properties)16 SubConfiguration (org.jpos.core.SubConfiguration)15 ISOMsg (org.jpos.iso.ISOMsg)14 LogEvent (org.jpos.util.LogEvent)14 ConfigurationException (org.jpos.core.ConfigurationException)9 ASCIIChannel (org.jpos.iso.channel.ASCIIChannel)7 Logger (org.jpos.util.Logger)7 ISOFilter (org.jpos.iso.ISOFilter)6 GZIPChannel (org.jpos.iso.channel.GZIPChannel)4 ISOBaseValidatingPackager (org.jpos.iso.packager.ISOBaseValidatingPackager)4 PostChannel (org.jpos.iso.channel.PostChannel)3 PostPackager (org.jpos.iso.packager.PostPackager)3 XMLPackager (org.jpos.iso.packager.XMLPackager)3 Element (org.jdom2.Element)2 BASE24TCPChannel (org.jpos.iso.channel.BASE24TCPChannel)2 LogChannel (org.jpos.iso.channel.LogChannel)2 PADChannel (org.jpos.iso.channel.PADChannel)2