Search in sources :

Example 46 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.Test)

Example 47 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("Test completed without Exception", true);
    // 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.Test)

Example 48 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("Test completed without Exception", true);
    // 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.Test)

Example 49 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.Test)

Example 50 with SimpleConfiguration

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

the class VAPChannelTest method testSetConfiguration1.

@Test
public void testSetConfiguration1() throws Throwable {
    VAPChannel vAPChannel = new VAPChannel(new Base1SubFieldPackager());
    vAPChannel.setConfiguration(new SimpleConfiguration());
    assertEquals("vAPChannel.srcid", "000000", vAPChannel.srcid);
    assertEquals("vAPChannel.dstid", "000000", vAPChannel.dstid);
    assertEquals("vAPChannel.getMaxPacketLength()", 100000, vAPChannel.getMaxPacketLength());
    assertEquals("vAPChannel.getPort()", 0, vAPChannel.getPort());
    assertNull("vAPChannel.getSocket()", vAPChannel.getSocket());
    assertEquals("vAPChannel.getTimeout()", 300000, vAPChannel.getTimeout());
    assertFalse("vAPChannel.isOverrideHeader()", vAPChannel.isOverrideHeader());
    assertNull("vAPChannel.getHost()", vAPChannel.getHost());
}
Also used : Base1SubFieldPackager(org.jpos.iso.packager.Base1SubFieldPackager) SimpleConfiguration(org.jpos.core.SimpleConfiguration) Test(org.junit.Test)

Aggregations

SimpleConfiguration (org.jpos.core.SimpleConfiguration)65 Test (org.junit.Test)55 Configuration (org.jpos.core.Configuration)24 SubConfiguration (org.jpos.core.SubConfiguration)15 ISOMsg (org.jpos.iso.ISOMsg)15 Properties (java.util.Properties)14 LogEvent (org.jpos.util.LogEvent)14 ConfigurationException (org.jpos.core.ConfigurationException)9 ASCIIChannel (org.jpos.iso.channel.ASCIIChannel)7 ISOFilter (org.jpos.iso.ISOFilter)6 Logger (org.jpos.util.Logger)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 BASE24TCPChannel (org.jpos.iso.channel.BASE24TCPChannel)2 LogChannel (org.jpos.iso.channel.LogChannel)2 PADChannel (org.jpos.iso.channel.PADChannel)2 Base1Packager (org.jpos.iso.packager.Base1Packager)2