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()");
}
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");
}
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");
}
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;
}
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);
}
Aggregations