Search in sources :

Example 16 with SubConfiguration

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

the class TransactionManagerTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    Configuration cfg = new SubConfiguration();
    try {
        transactionManager.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertFalse("transactionManager.debug", transactionManager.debug);
        assertSame("transactionManager.getConfiguration()", cfg, transactionManager.getConfiguration());
        assertEquals("transactionManager.pauseTimeout", 0L, transactionManager.pauseTimeout);
        assertEquals("transactionManager.retryInterval", 5000L, transactionManager.retryInterval);
    }
}
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 17 with SubConfiguration

use of org.jpos.core.SubConfiguration 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());
    }
}
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 18 with SubConfiguration

use of org.jpos.core.SubConfiguration 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());
    }
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) Test(org.junit.Test)

Example 19 with SubConfiguration

use of org.jpos.core.SubConfiguration 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());
    }
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) Test(org.junit.Test)

Example 20 with SubConfiguration

use of org.jpos.core.SubConfiguration 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());
    }
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) Test(org.junit.Test)

Aggregations

SubConfiguration (org.jpos.core.SubConfiguration)25 Test (org.junit.Test)25 Configuration (org.jpos.core.Configuration)23 SimpleConfiguration (org.jpos.core.SimpleConfiguration)18 Logger (org.jpos.util.Logger)4 Properties (java.util.Properties)3 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1 ConfigurationException (org.jpos.core.ConfigurationException)1 GenericPackager (org.jpos.iso.packager.GenericPackager)1