Search in sources :

Example 16 with Configuration

use of org.jpos.core.Configuration 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 17 with Configuration

use of org.jpos.core.Configuration 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 18 with Configuration

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

the class TransactionManagerTest method testSetConfiguration.

@Test
public void testSetConfiguration() throws Throwable {
    Configuration cfg = new SimpleConfiguration();
    transactionManager.setConfiguration(cfg);
    assertTrue("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) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.Test)

Example 19 with Configuration

use of org.jpos.core.Configuration 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 20 with Configuration

use of org.jpos.core.Configuration 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

Configuration (org.jpos.core.Configuration)49 Test (org.junit.Test)45 SimpleConfiguration (org.jpos.core.SimpleConfiguration)39 SubConfiguration (org.jpos.core.SubConfiguration)35 ConfigurationException (org.jpos.core.ConfigurationException)8 Properties (java.util.Properties)4 Logger (org.jpos.util.Logger)4 LogEvent (org.jpos.util.LogEvent)3 Configurable (org.jpos.core.Configurable)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 PrintStream (java.io.PrintStream)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 StringTokenizer (java.util.StringTokenizer)1 ISOChannel (org.jpos.iso.ISOChannel)1 ISOMsg (org.jpos.iso.ISOMsg)1 ISOVMsg (org.jpos.iso.ISOVMsg)1 CSChannel (org.jpos.iso.channel.CSChannel)1 LogChannel (org.jpos.iso.channel.LogChannel)1