Search in sources :

Example 1 with Configuration

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

the class BSHFilterTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    BSHFilter bSHFilter = new BSHFilter();
    Configuration cfg = new SimpleConfiguration();
    bSHFilter.setConfiguration(cfg);
    assertSame("bSHFilter.cfg", cfg, bSHFilter.cfg);
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.Test)

Example 2 with Configuration

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

the class BSHFilterTest method testFilter1.

@Test
public void testFilter1() throws Throwable {
    BSHFilter bSHFilter = new BSHFilter();
    Configuration cfg = new SimpleConfiguration();
    bSHFilter.setConfiguration(cfg);
    ISOChannel channel = new CSChannel();
    LogEvent evt = new LogEvent();
    ISOVMsg result = (ISOVMsg) bSHFilter.filter(channel, m, evt);
    assertSame("result", m, result);
    assertSame("bSHFilter.cfg", cfg, bSHFilter.cfg);
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) LogEvent(org.jpos.util.LogEvent) SimpleConfiguration(org.jpos.core.SimpleConfiguration) ISOVMsg(org.jpos.iso.ISOVMsg) ISOChannel(org.jpos.iso.ISOChannel) CSChannel(org.jpos.iso.channel.CSChannel) Test(org.junit.Test)

Example 3 with Configuration

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

the class BSHLogListenerTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    BSHLogListener bSHLogListener = new BSHLogListener();
    Configuration cfg = new SimpleConfiguration(new Properties());
    bSHLogListener.setConfiguration(cfg);
    assertSame("bSHLogListener.cfg", cfg, bSHLogListener.cfg);
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Properties(java.util.Properties) Test(org.junit.Test)

Example 4 with Configuration

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

the class BSHRequestListenerTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    BSHRequestListener bSHRequestListener = new BSHRequestListener();
    Configuration cfg = new SimpleConfiguration();
    bSHRequestListener.setConfiguration(cfg);
    assertEquals("bSHRequestListener.whitelist.size()", 1, bSHRequestListener.whitelist.size());
    assertEquals("bSHRequestListener.bshSource.length", 0, bSHRequestListener.bshSource.length);
    assertSame("bSHRequestListener.cfg", cfg, bSHRequestListener.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 5 with Configuration

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

the class ConnectorTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    Connector connector = new Connector();
    Configuration cfg = new SubConfiguration();
    try {
        connector.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertEquals("connector.timeout", 0, connector.timeout);
        assertNull("connector.channelName", connector.channelName);
        assertNull("connector.muxName", connector.muxName);
    }
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) 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