Search in sources :

Example 11 with SimpleConfiguration

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

the class VAPChannelTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    VAPChannel vAPChannel = new VAPChannel(new Base1Packager());
    vAPChannel.setSocketFactory(new GenericSSLSocketFactory());
    vAPChannel.setConfiguration(new SimpleConfiguration());
    assertEquals("000000", vAPChannel.srcid, "vAPChannel.srcid");
    assertEquals("000000", vAPChannel.dstid, "vAPChannel.dstid");
    assertEquals(100000, vAPChannel.getMaxPacketLength(), "vAPChannel.getMaxPacketLength()");
    assertEquals(0, vAPChannel.getPort(), "vAPChannel.getPort()");
    assertNull(vAPChannel.getSocket(), "vAPChannel.getSocket()");
    assertEquals(300000, vAPChannel.getTimeout(), "vAPChannel.getTimeout()");
    assertFalse(vAPChannel.isOverrideHeader(), "vAPChannel.isOverrideHeader()");
    assertNull(vAPChannel.getHost(), "vAPChannel.getHost()");
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Base1Packager(org.jpos.iso.packager.Base1Packager) Test(org.junit.jupiter.api.Test)

Example 12 with SimpleConfiguration

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

the class DelayFilterTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    DelayFilter delayFilter = new DelayFilter(100);
    delayFilter.setConfiguration(new SimpleConfiguration());
    assertEquals(0, delayFilter.delay, "delayFilter.delay");
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.jupiter.api.Test)

Example 13 with SimpleConfiguration

use of org.jpos.core.SimpleConfiguration 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(cfg, macroFilter.cfg, "macroFilter.cfg");
    assertEquals(0, macroFilter.unsetFields.length, "macroFilter.unsetFields.length");
    assertEquals(0, macroFilter.validFields.length, "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.jupiter.api.Test)

Example 14 with SimpleConfiguration

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

the class RotateLogListenerTest method createRotateLogListenerWithIsoDateFormat.

private RotateLogListener createRotateLogListenerWithIsoDateFormat(String logFileName, Properties customConfig) throws ConfigurationException, IOException {
    RotateLogListener listener = new RotateLogListener();
    Properties configuration = new Properties();
    configuration.setProperty("file", logRotationTestDirectory.getDirectory().toAbsolutePath() + "/" + logFileName);
    configuration.setProperty("copies", "10");
    configuration.setProperty("maxsize", "1000000");
    if (customConfig != null) {
        configuration.putAll(customConfig);
    }
    logRotationTestDirectory.allowNewFileCreation();
    listener.setConfiguration(new SimpleConfiguration(configuration));
    return listener;
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Properties(java.util.Properties)

Example 15 with SimpleConfiguration

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

the class RemoveNewLinesMapperTest method testDefaultValues.

@Test
void testDefaultValues() throws ConfigurationException {
    RemoveNewLinesMapper mapper = new RemoveNewLinesMapper();
    assertFalse(mapper.combineSpaces);
    assertTrue(mapper.newLineAtEnd);
    SimpleConfiguration cfg = new SimpleConfiguration();
    mapper.setConfiguration(cfg);
    assertFalse(mapper.combineSpaces);
    assertTrue(mapper.newLineAtEnd);
}
Also used : 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