Search in sources :

Example 6 with SubConfiguration

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

the class MacroFilterTest method testSetConfigurationThrowsNullPointerException.

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

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

the class StatefulFilterTest method testSetConfigurationThrowsNullPointerException.

@Test
public void testSetConfigurationThrowsNullPointerException() throws Throwable {
    StatefulFilter statefulFilter = new StatefulFilter();
    Configuration cfg = new SubConfiguration();
    try {
        statefulFilter.setConfiguration(cfg);
        fail("Expected NullPointerException to be thrown");
    } catch (NullPointerException ex) {
        assertNull("ex.getMessage()", ex.getMessage());
        assertFalse("m_statefulFilter.isOverwriteOriginalFields()", statefulFilter.isOverwriteOriginalFields());
        assertEquals("m_statefulFilter.getSavedFields().length", 0, statefulFilter.getSavedFields().length);
        assertEquals("m_statefulFilter.getIgnoredFields().length", 0, statefulFilter.getIgnoredFields().length);
        assertEquals("m_statefulFilter.getKey().length", 2, statefulFilter.getKey().length);
        assertFalse("m_statefulFilter.isVetoUnmatched()", statefulFilter.isVetoUnmatched());
        assertEquals("m_statefulFilter.getMatchDirection()", 1, statefulFilter.getMatchDirection());
        assertEquals("m_statefulFilter.getTimeout()", 60000L, statefulFilter.getTimeout());
    }
}
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 8 with SubConfiguration

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

the class GenericPackagerTest method testSetConfigurationThrowsNullPointerException.

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

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

the class DirPollTest method testSetConfigurationThrowsNullPointerException2.

@Test
public void testSetConfigurationThrowsNullPointerException2() throws Throwable {
    Configuration cfg = new SubConfiguration();
    DirPoll dirPoll = new DirPoll();
    dirPoll.setProcessor("");
    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 10 with SubConfiguration

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

the class DirPollTest method testSetConfigurationThrowsNullPointerException3.

@Test
public void testSetConfigurationThrowsNullPointerException3() throws Throwable {
    Configuration cfg = new SubConfiguration();
    DirPoll dirPoll = new DirPoll();
    dirPoll.setProcessor(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