Search in sources :

Example 11 with Configuration

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

the class VAPChannelTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    VAPChannel vAPChannel = new VAPChannel(new GenericPackager());
    Configuration cfg = new SubConfiguration();
    try {
        vAPChannel.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertEquals("vAPChannel.getMaxPacketLength()", 100000, vAPChannel.getMaxPacketLength());
        assertEquals("vAPChannel.getPort()", 0, vAPChannel.getPort());
        assertNull("vAPChannel.getSocket()", vAPChannel.getSocket());
        assertEquals("vAPChannel.getTimeout()", 0, vAPChannel.getTimeout());
        assertEquals("vAPChannel.srcid", "000000", vAPChannel.srcid);
        assertFalse("vAPChannel.isOverrideHeader()", vAPChannel.isOverrideHeader());
        assertNull("vAPChannel.getHost()", vAPChannel.getHost());
        assertEquals("vAPChannel.dstid", "000000", vAPChannel.dstid);
    }
}
Also used : GenericPackager(org.jpos.iso.packager.GenericPackager) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) SubConfiguration(org.jpos.core.SubConfiguration) Test(org.junit.Test)

Example 12 with Configuration

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

the class MD5FilterTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    MD5Filter mD5Filter = new MD5Filter();
    Configuration cfg = new SubConfiguration();
    try {
        mD5Filter.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertNull("mD5Filter.key", mD5Filter.key);
        assertNull("mD5Filter.fields", mD5Filter.fields);
    }
}
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)

Example 13 with Configuration

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

the class MacroFilterTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    MacroFilter macroFilter = new MacroFilter();
    Configuration cfg = new SubConfiguration();
    try {
        macroFilter.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertSame("macroFilter.cfg", cfg, macroFilter.cfg);
        assertNull("ex.getMessage()", ex.getMessage());
        assertEquals("macroFilter.unsetFields.length", 0, macroFilter.unsetFields.length);
        assertEquals("macroFilter.validFields.length", 0, macroFilter.validFields.length);
        assertNull("macroFilter.seq", macroFilter.seq);
    }
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) SubConfiguration(org.jpos.core.SubConfiguration) Test(org.junit.Test)

Example 14 with Configuration

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

the class MacroFilterTest method testSetConfiguration1.

@Test
public void testSetConfiguration1() throws Throwable {
    MacroFilter macroFilter = new MacroFilter();
    Configuration cfg = new SimpleConfiguration();
    macroFilter.setConfiguration(cfg);
    macroFilter.setConfiguration(cfg);
    assertSame("macroFilter.cfg", cfg, macroFilter.cfg);
    assertEquals("macroFilter.unsetFields.length", 0, macroFilter.unsetFields.length);
    assertEquals("macroFilter.validFields.length", 0, macroFilter.validFields.length);
}
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.Test)

Example 15 with Configuration

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

the class MacroFilterTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    MacroFilter macroFilter = new MacroFilter();
    Configuration cfg = new SimpleConfiguration();
    macroFilter.setConfiguration(cfg);
    assertNotNull("macroFilter.seq", macroFilter.seq);
    assertSame("macroFilter.cfg", cfg, macroFilter.cfg);
    assertEquals("macroFilter.unsetFields.length", 0, macroFilter.unsetFields.length);
    assertEquals("macroFilter.validFields.length", 0, macroFilter.validFields.length);
}
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.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