use of org.jpos.core.Configuration in project jPOS by jpos.
the class FilterLogListenerTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Throwable {
FilterLogListener filterLogListener = new FilterLogListener();
Configuration cfg = new SimpleConfiguration();
filterLogListener.setConfiguration(cfg);
assertEquals("filterLogListener.getPriority()", "info", filterLogListener.getPriority());
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class ProtectedLogListenerTest method testSetConfiguration.
@Test
public void testSetConfiguration() throws Throwable {
ProtectedLogListener protectedLogListener = new ProtectedLogListener();
Configuration cfg = new SimpleConfiguration();
protectedLogListener.setConfiguration(cfg);
assertEquals("protectedLogListener.protectFields.length", 0, protectedLogListener.protectFields.length);
assertEquals("protectedLogListener.wipeFields.length", 0, protectedLogListener.wipeFields.length);
assertSame("protectedLogListener.cfg", cfg, protectedLogListener.cfg);
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class RotateLogListenerTest method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
RotateLogListener rotateLogListener = new RotateLogListener();
Configuration cfg = new SubConfiguration();
try {
rotateLogListener.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertNull("rotateLogListener.logName", rotateLogListener.logName);
assertEquals("rotateLogListener.sleepTime", 0L, rotateLogListener.sleepTime);
assertEquals("rotateLogListener.maxSize", 0L, rotateLogListener.maxSize);
assertEquals("rotateLogListener.maxCopies", 0, rotateLogListener.maxCopies);
assertNull("rotateLogListener.rotate", rotateLogListener.rotate);
assertNull("rotateLogListener.f", rotateLogListener.f);
assertNotNull("rotateLogListener.p", rotateLogListener.p);
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class DailyTaskAdaptorTest method testWaitUntilStartTimeThrowsNumberFormatException.
@Test
public void testWaitUntilStartTimeThrowsNumberFormatException() throws Throwable {
DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor();
Configuration cfg = new SimpleConfiguration();
dailyTaskAdaptor.setConfiguration(cfg);
try {
dailyTaskAdaptor.waitUntilStartTime();
fail("Expected NumberFormatException to be thrown");
} catch (NumberFormatException ex) {
assertEquals("ex.getMessage()", "For input string: \":0\"", ex.getMessage());
assertSame("dailyTaskAdaptor.getConfiguration()", cfg, dailyTaskAdaptor.getConfiguration());
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class BSHFilterTest method testFilter.
@Test
public void testFilter() throws Throwable {
Configuration cfg = new SimpleConfiguration();
BSHFilter bSHFilter = new BSHFilter();
bSHFilter.setConfiguration(cfg);
ISOMsg result = bSHFilter.filter(new PADChannel(), null, new LogEvent("testBSHFilterTag", "testString"));
assertNull("result", result);
assertSame("bSHFilter.cfg", cfg, bSHFilter.cfg);
}
Aggregations