Search in sources :

Example 21 with SubConfiguration

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

Example 22 with SubConfiguration

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

the class BSHRequestListenerTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    BSHRequestListener bSHRequestListener = new BSHRequestListener();
    Configuration cfg = new SubConfiguration();
    try {
        bSHRequestListener.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertSame("bSHRequestListener.cfg", cfg, bSHRequestListener.cfg);
        assertNull("ex.getMessage()", ex.getMessage());
        assertNull("bSHRequestListener.whitelist", bSHRequestListener.whitelist);
        assertNull("bSHRequestListener.bshSource", bSHRequestListener.bshSource);
    }
}
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 23 with SubConfiguration

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

the class JCESecurityModuleTest method testConstructorThrowsNullPointerException2.

@Test
public void testConstructorThrowsNullPointerException2() throws Throwable {
    Configuration cfg = new SubConfiguration();
    try {
        new JCESecurityModule(cfg, new Logger(), "testJCESecurityModuleRealm");
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) SubConfiguration(org.jpos.core.SubConfiguration) Logger(org.jpos.util.Logger) Test(org.junit.Test)

Example 24 with SubConfiguration

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

the class JCESecurityModuleTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    JCESecurityModule jCESecurityModule = new JCESecurityModule();
    Configuration cfg = new SubConfiguration();
    try {
        jCESecurityModule.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
    }
}
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 25 with SubConfiguration

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

the class DelayFilterTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    DelayFilter delayFilter = new DelayFilter(100);
    Configuration cfg = new SubConfiguration();
    try {
        delayFilter.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertEquals("delayFilter.delay", 100, delayFilter.delay);
    }
}
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)

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