Search in sources :

Example 26 with ConfigurationException

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

the class QFactory2Test method testSetConfigurationThrowsConfigurationException.

@Test
public void testSetConfigurationThrowsConfigurationException() throws Throwable {
    String[] args = new String[0];
    try {
        new QFactory(null, new Q2(args)).setConfiguration(new BSHTransactionParticipant(), null);
        fail("Expected ConfigurationException to be thrown");
    } catch (ConfigurationException ex) {
        assertEquals("ex.getMessage()", "org.jpos.core.ConfigurationException (java.lang.NullPointerException)", ex.getMessage());
        assertNull("ex.getNested().getMessage()", ex.getNested().getMessage());
    }
}
Also used : BSHTransactionParticipant(org.jpos.transaction.participant.BSHTransactionParticipant) ConfigurationException(org.jpos.core.ConfigurationException) Test(org.junit.Test)

Example 27 with ConfigurationException

use of org.jpos.core.ConfigurationException 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 28 with ConfigurationException

use of org.jpos.core.ConfigurationException 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 29 with ConfigurationException

use of org.jpos.core.ConfigurationException 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 30 with ConfigurationException

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

Aggregations

ConfigurationException (org.jpos.core.ConfigurationException)52 Element (org.jdom2.Element)10 SimpleConfiguration (org.jpos.core.SimpleConfiguration)10 Test (org.junit.Test)9 Configuration (org.jpos.core.Configuration)8 Configurable (org.jpos.core.Configurable)5 SubConfiguration (org.jpos.core.SubConfiguration)5 NameRegistrar (org.jpos.util.NameRegistrar)4 IOException (java.io.IOException)3 Date (java.util.Date)3 Properties (java.util.Properties)3 LogSource (org.jpos.util.LogSource)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)2 ParseException (java.text.ParseException)2 SimpleDateFormat (java.text.SimpleDateFormat)2 StringTokenizer (java.util.StringTokenizer)2 Timer (java.util.Timer)2 ISOException (org.jpos.iso.ISOException)2 Logger (org.jpos.util.Logger)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1