Package org.jpos.core

Examples of org.jpos.core.Configuration


    }

    @Test
    public void testSetConfigurationThrowsConfigurationException() throws Throwable {
        FilterLogListener filterLogListener = new FilterLogListener(new PrintStream(new ByteArrayOutputStream()));
        Configuration cfg = new SubConfiguration();
        try {
            filterLogListener.setConfiguration(cfg);
            fail("Expected ConfigurationException to be thrown");
        } catch (ConfigurationException ex) {
            assertEquals("ex.getMessage()", "java.lang.NullPointerException", ex.getMessage());
View Full Code Here


public class BaseSMAdapterTest {

    @Test
    public void testConstructor() throws Throwable {
        Configuration cfg = new SubConfiguration(new SimpleConfiguration(new Properties(null)), "testBaseSMAdapterPrefix");
        Logger logger = new Logger();
        BaseSMAdapter baseSMAdapter = new BaseSMAdapter(cfg, logger, "testBaseSMAdapterRealm");
        assertSame("baseSMAdapter.cfg", cfg, baseSMAdapter.cfg);
        assertEquals("baseSMAdapter.realm", "testBaseSMAdapterRealm", baseSMAdapter.realm);
        assertSame("baseSMAdapter.logger", logger, baseSMAdapter.logger);
View Full Code Here

    }

    @Test
    public void testSetConfiguration() throws Throwable {
        BaseSMAdapter baseSMAdapter = new BaseSMAdapter();
        Configuration cfg = new SimpleConfiguration();
        baseSMAdapter.setConfiguration(cfg);
        assertSame("baseSMAdapter.cfg", cfg, baseSMAdapter.cfg);
    }
View Full Code Here

        }
    }

    @Test
    public void testInitServiceThrowsConfigurationException() throws Throwable {
        Configuration cfg = new SimpleConfiguration();
        transactionManager.setConfiguration(cfg);
        try {
            transactionManager.initService();
            fail("Expected ConfigurationException to be thrown");
        } catch (ConfigurationException ex) {
View Full Code Here

        assertTrue("Test completed without Exception", true);
    }

    @Test
    public void testSetConfiguration() throws Throwable {
        Configuration cfg = new SimpleConfiguration();
        transactionManager.setConfiguration(cfg);
        assertFalse("transactionManager.debug", transactionManager.debug);
        assertSame("transactionManager.getConfiguration()", cfg, transactionManager.getConfiguration());
        assertEquals("transactionManager.pauseTimeout", 0L, transactionManager.pauseTimeout);
        assertEquals("transactionManager.retryInterval", 5000L, transactionManager.retryInterval);
View Full Code Here

        assertEquals("transactionManager.retryInterval", 5000L, transactionManager.retryInterval);
    }

    @Test
    public void testSetConfigurationThrowsNullPointerException() throws Throwable {
        Configuration cfg = new SubConfiguration();
        try {
            transactionManager.setConfiguration(cfg);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
View Full Code Here

    }

    @Test
    public void testSetConfigurationThrowsConfigurationException() throws Throwable {
        SimpleKeyFile simpleKeyFile = new SimpleKeyFile();
        Configuration cfg = new SimpleConfiguration(new Properties());
        try {
            simpleKeyFile.setConfiguration(cfg);
            fail("Expected ConfigurationException to be thrown");
        } catch (ConfigurationException ex) {
            assertEquals("simpleKeyFile.file.getName()", "", simpleKeyFile.file.getName());
View Full Code Here

    }

    @Test
    public void testSetConfigurationThrowsNullPointerException() throws Throwable {
        Connector connector = new Connector();
        Configuration cfg = new SubConfiguration();
        try {
            connector.setConfiguration(cfg);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
View Full Code Here

    {
        String configurationFactoryClazz = e.getAttributeValue("configuration-factory");
        ConfigurationFactory cf = configurationFactoryClazz != null ?
            (ConfigurationFactory) newInstance(configurationFactoryClazz) : defaultConfigurationFactory;

        Configuration cfg = cf.getConfiguration(e);
        String merge = e.getAttributeValue("merge-configuration");
        if (merge != null) {
            StringTokenizer st = new StringTokenizer(merge, ", ");
            while (st.hasMoreElements()) {
                try {
                    Configuration c = QConfig.getConfiguration(st.nextToken());
                    for (String k : c.keySet()) {
                        if (cfg.get(k, null) == null) {
                            String[] v = c.getAll(k);
                            switch (v.length) {
                                case 0:
                                    break;
                                case 1:
                                    cfg.put(k, v[0]);
View Full Code Here

        dirPoll.setThreadPool (new ThreadPool (1, poolSize));
        dirPoll.setPollInterval (pollInterval);
        if (priorities != null)
            dirPoll.setPriorities (priorities);
        dirPoll.setLogger (getLog().getLogger(), getLog().getRealm ());
        Configuration cfg = factory.getConfiguration (getPersist());
        dirPoll.setConfiguration (cfg);
        dirPoll.createDirs ();
        Object dpp = factory.newInstance (getProcessor());
        if (dpp instanceof LogSource) {
            ((LogSource) dpp).setLogger (
View Full Code Here

TOP

Related Classes of org.jpos.core.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.