use of org.jpos.core.Configuration in project jPOS by jpos.
the class TransactionManagerTest method testInitServiceThrowsConfigurationException.
@Test
public void testInitServiceThrowsConfigurationException() throws Throwable {
Configuration cfg = new SimpleConfiguration();
transactionManager.setConfiguration(cfg);
try {
transactionManager.initService();
fail("Expected ConfigurationException to be thrown");
} catch (ConfigurationException ex) {
assertEquals("ex.getMessage()", "queue property not specified", ex.getMessage());
assertNull("ex.getNested()", ex.getNested());
assertNull("transactionManager.queue", transactionManager.queue);
assertSame("transactionManager.getConfiguration()", cfg, transactionManager.getConfiguration());
assertEquals("transactionManager.tail", 0L, transactionManager.tail);
assertTrue("transactionManager.isModified()", transactionManager.isModified());
assertNull("transactionManager.sp", transactionManager.sp);
assertNull("transactionManager.psp", transactionManager.psp);
assertEquals("transactionManager.head", 0L, transactionManager.head);
assertNull("transactionManager.groups", transactionManager.groups);
assertNull("transactionManager.tailLock", transactionManager.tailLock);
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class DailyLogListenerTest method testSetConfigurationThrowsNullPointerException.
@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
DailyLogListener dailyLogListener = new DailyLogListener();
Configuration cfg = new SubConfiguration();
try {
dailyLogListener.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
assertNull("dailyLogListener.rotate", dailyLogListener.rotate);
assertEquals("dailyLogListener.getCompressionBufferSize()", 131072, dailyLogListener.getCompressionBufferSize());
assertNotNull("dailyLogListener.p", dailyLogListener.p);
assertNull("dailyLogListener.getPrefix()", dailyLogListener.getPrefix());
assertEquals("dailyLogListener.getSuffix()", ".log", dailyLogListener.getSuffix());
assertNull("dailyLogListener.f", dailyLogListener.f);
assertEquals("dailyLogListener.getCompressedSuffix()", "", dailyLogListener.getCompressedSuffix());
assertNull("dailyLogListener.logName", dailyLogListener.logName);
assertEquals("dailyLogListener.sleepTime", 0L, dailyLogListener.sleepTime);
assertEquals("dailyLogListener.maxSize", 0L, dailyLogListener.maxSize);
assertEquals("dailyLogListener.getCompressionFormat()", 0, dailyLogListener.getCompressionFormat());
assertTrue("dailyLogListener.getDateFmt().isLenient()", dailyLogListener.getDateFmt().isLenient());
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class DirPollTest method testSetConfigurationThrowsNullPointerException1.
@Test
public void testSetConfigurationThrowsNullPointerException1() throws Throwable {
Configuration cfg = new SubConfiguration();
DirPoll processor = new DirPoll();
DirPoll dirPoll = new DirPoll();
processor.setProcessor("");
dirPoll.setProcessor(processor);
try {
dirPoll.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class DirPollTest method testSetConfigurationThrowsStackOverflowError.
@Test
public void testSetConfigurationThrowsStackOverflowError() throws Throwable {
Configuration cfg = new SubConfiguration();
DirPoll processor = new DirPoll();
processor.setProcessor(processor);
try {
processor.setConfiguration(cfg);
fail("Expected StackOverflowError to be thrown");
} catch (StackOverflowError ex) {
assertEquals("ex.getClass()", StackOverflowError.class, ex.getClass());
}
}
use of org.jpos.core.Configuration in project jPOS by jpos.
the class DirPollTest method testSetConfigurationThrowsNullPointerException4.
@Test
public void testSetConfigurationThrowsNullPointerException4() throws Throwable {
Configuration cfg = new SubConfiguration();
DirPoll dirPoll = new DirPoll();
try {
dirPoll.setConfiguration(cfg);
fail("Expected NullPointerException to be thrown");
} catch (NullPointerException ex) {
assertNull("ex.getMessage()", ex.getMessage());
}
}
Aggregations