Search in sources :

Example 1 with SubConfiguration

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

the class ConnectorTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    Connector connector = new Connector();
    Configuration cfg = new SubConfiguration();
    try {
        connector.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertEquals("connector.timeout", 0, connector.timeout);
        assertNull("connector.channelName", connector.channelName);
        assertNull("connector.muxName", connector.muxName);
    }
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) Configuration(org.jpos.core.Configuration) SubConfiguration(org.jpos.core.SubConfiguration) Test(org.junit.Test)

Example 2 with SubConfiguration

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

the class TEST01001Test method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    TEST0100 tEST0100 = new TEST0100();
    Configuration cfg = new SubConfiguration();
    try {
        tEST0100.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 3 with SubConfiguration

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

the class ChannelPoolTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    ChannelPool channelPool = new ChannelPool();
    Configuration cfg = new SubConfiguration();
    try {
        channelPool.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertSame("channelPool.cfg", cfg, channelPool.cfg);
        assertNull("ex.getMessage()", ex.getMessage());
        assertEquals("channelPool.pool.size()", 0, channelPool.pool.size());
    }
}
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 4 with SubConfiguration

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

the class VAPChannelTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    VAPChannel vAPChannel = new VAPChannel(new GenericPackager());
    Configuration cfg = new SubConfiguration();
    try {
        vAPChannel.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertEquals("vAPChannel.getMaxPacketLength()", 100000, vAPChannel.getMaxPacketLength());
        assertEquals("vAPChannel.getPort()", 0, vAPChannel.getPort());
        assertNull("vAPChannel.getSocket()", vAPChannel.getSocket());
        assertEquals("vAPChannel.getTimeout()", 0, vAPChannel.getTimeout());
        assertEquals("vAPChannel.srcid", "000000", vAPChannel.srcid);
        assertFalse("vAPChannel.isOverrideHeader()", vAPChannel.isOverrideHeader());
        assertNull("vAPChannel.getHost()", vAPChannel.getHost());
        assertEquals("vAPChannel.dstid", "000000", vAPChannel.dstid);
    }
}
Also used : GenericPackager(org.jpos.iso.packager.GenericPackager) 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 5 with SubConfiguration

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

the class MD5FilterTest method testSetConfigurationThrowsNullPointerException.

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