Search in sources :

Example 6 with Configuration

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());
    }
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) Test(org.junit.Test)

Example 7 with Configuration

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());
    }
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.Test)

Example 8 with Configuration

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());
    }
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.Test)

Example 9 with Configuration

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);
}
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.Test)

Example 10 with Configuration

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());
    }
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) Test(org.junit.Test)

Aggregations

Configuration (org.jpos.core.Configuration)49 Test (org.junit.Test)45 SimpleConfiguration (org.jpos.core.SimpleConfiguration)39 SubConfiguration (org.jpos.core.SubConfiguration)35 ConfigurationException (org.jpos.core.ConfigurationException)8 Properties (java.util.Properties)4 Logger (org.jpos.util.Logger)4 LogEvent (org.jpos.util.LogEvent)3 Configurable (org.jpos.core.Configurable)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 StringTokenizer (java.util.StringTokenizer)1 ISOChannel (org.jpos.iso.ISOChannel)1 ISOMsg (org.jpos.iso.ISOMsg)1 ISOVMsg (org.jpos.iso.ISOVMsg)1 CSChannel (org.jpos.iso.channel.CSChannel)1 LogChannel (org.jpos.iso.channel.LogChannel)1