Search in sources :

Example 36 with SimpleConfiguration

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

the class JCESecurityModuleTest method testSetConfigurationThrowsConfigurationException.

@Test
public void testSetConfigurationThrowsConfigurationException() throws Throwable {
    JCESecurityModule jCESecurityModule = new JCESecurityModule();
    Configuration cfg = new SimpleConfiguration();
    try {
        jCESecurityModule.setConfiguration(cfg);
        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) Test(org.junit.jupiter.api.Test)

Example 37 with SimpleConfiguration

use of org.jpos.core.SimpleConfiguration 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.jupiter.api.Test)

Example 38 with SimpleConfiguration

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

the class JCESecurityModuleTest method testConstructorThrowsConfigurationException.

@Test
public void testConstructorThrowsConfigurationException() throws Throwable {
    try {
        new JCESecurityModule(new SimpleConfiguration(), Logger.getLogger("."), "testJCESecurityModuleRealm");
        fail("Expected ConfigurationException to be thrown");
    } catch (ConfigurationException ex) {
        assertTrue(true, "Test completed without Exception");
    // dependencies on static and environment state led to removal of 4
    // assertions
    }
}
Also used : ConfigurationException(org.jpos.core.ConfigurationException) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.jupiter.api.Test)

Example 39 with SimpleConfiguration

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

the class JCESecurityModuleTest method testSetConfigurationThrowsConfigurationException1.

@Test
public void testSetConfigurationThrowsConfigurationException1() throws Throwable {
    JCESecurityModule jCESecurityModule = new JCESecurityModule();
    jCESecurityModule.setLogger(Logger.getLogger("."), "testJCESecurityModuleRealm");
    try {
        jCESecurityModule.setConfiguration(new SimpleConfiguration());
        fail("Expected ConfigurationException to be thrown");
    } catch (ConfigurationException ex) {
        assertTrue(true, "Test completed without Exception");
    // dependencies on static and environment state led to removal of 8
    // assertions
    }
}
Also used : ConfigurationException(org.jpos.core.ConfigurationException) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.jupiter.api.Test)

Example 40 with SimpleConfiguration

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

the class DailyTaskAdaptorTest method testWaitUntilStartTimeThrowsNumberFormatException.

@Test
public void testWaitUntilStartTimeThrowsNumberFormatException() throws Throwable {
    DailyTaskAdaptor dailyTaskAdaptor = new DailyTaskAdaptor();
    Configuration cfg = new SimpleConfiguration();
    dailyTaskAdaptor.setConfiguration(cfg);
    try {
        dailyTaskAdaptor.waitUntilStartTime();
        fail("Expected NumberFormatException to be thrown");
    } catch (NumberFormatException ex) {
        assertEquals("For input string: \":0\"", ex.getMessage(), "ex.getMessage()");
        assertSame(cfg, dailyTaskAdaptor.getConfiguration(), "dailyTaskAdaptor.getConfiguration()");
    }
}
Also used : SimpleConfiguration(org.jpos.core.SimpleConfiguration) Configuration(org.jpos.core.Configuration) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.jupiter.api.Test)

Aggregations

SimpleConfiguration (org.jpos.core.SimpleConfiguration)71 Test (org.junit.jupiter.api.Test)59 Configuration (org.jpos.core.Configuration)25 Properties (java.util.Properties)16 SubConfiguration (org.jpos.core.SubConfiguration)15 ISOMsg (org.jpos.iso.ISOMsg)14 LogEvent (org.jpos.util.LogEvent)14 ConfigurationException (org.jpos.core.ConfigurationException)9 ASCIIChannel (org.jpos.iso.channel.ASCIIChannel)7 Logger (org.jpos.util.Logger)7 ISOFilter (org.jpos.iso.ISOFilter)6 GZIPChannel (org.jpos.iso.channel.GZIPChannel)4 ISOBaseValidatingPackager (org.jpos.iso.packager.ISOBaseValidatingPackager)4 PostChannel (org.jpos.iso.channel.PostChannel)3 PostPackager (org.jpos.iso.packager.PostPackager)3 XMLPackager (org.jpos.iso.packager.XMLPackager)3 Element (org.jdom2.Element)2 BASE24TCPChannel (org.jpos.iso.channel.BASE24TCPChannel)2 LogChannel (org.jpos.iso.channel.LogChannel)2 PADChannel (org.jpos.iso.channel.PADChannel)2