Search in sources :

Example 41 with Configuration

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

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

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

the class JCESecurityModuleTest method testConstructorThrowsConfigurationException1.

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

Example 44 with Configuration

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

Example 45 with Configuration

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

the class GenericPackagerTest method testSetConfigurationThrowsConfigurationException.

@Ignore("test failing")
@Test
public void testSetConfigurationThrowsConfigurationException() throws Throwable {
    GenericPackager genericPackager = new GenericPackager();
    Configuration cfg = new SimpleConfiguration();
    try {
        genericPackager.setConfiguration(cfg);
        fail("Expected ConfigurationException to be thrown");
    } catch (ConfigurationException ex) {
        assertEquals("ex.getMessage()", "org.jpos.iso.ISOException: java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl (java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl)", ex.getMessage());
        assertEquals("ex.getNested().getMessage()", "java.lang.ClassNotFoundException: org.apache.crimson.parser.XMLReaderImpl", ex.getNested().getMessage());
        assertEquals("(GenericValidatingPackager) genericValidatingPackager.getLogger().getName()", "", genericPackager.getLogger().getName());
        assertEquals("(GenericValidatingPackager) genericValidatingPackager.getRealm()", "", genericPackager.getRealm());
    }
}
Also used : SubConfiguration(org.jpos.core.SubConfiguration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) ConfigurationException(org.jpos.core.ConfigurationException) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Ignore(org.junit.Ignore) 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