Package org.jpos.core

Examples of org.jpos.core.SimpleConfiguration


    }

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


    @Test
    public void testSetConfiguration() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel(new ISO93BPackager(), null);
        gZIPChannel.setSocketFactory(new SunJSSESocketFactory());
        gZIPChannel.setConfiguration(new SimpleConfiguration());
        assertEquals("(GZIPChannel) gZIPChannel.getTimeout()", 300000, gZIPChannel.getTimeout());
        assertEquals("(GZIPChannel) gZIPChannel.getMaxPacketLength()", 100000, gZIPChannel.getMaxPacketLength());
        assertFalse("(GZIPChannel) gZIPChannel.overrideHeader", ((GZIPChannel) gZIPChannel).overrideHeader);
    }
View Full Code Here

    }

    @Test
    public void testSetConfiguration1() throws Throwable {
        BaseChannel gZIPChannel = new GZIPChannel();
        gZIPChannel.setConfiguration(new SimpleConfiguration());
        assertEquals("(GZIPChannel) gZIPChannel.getTimeout()", 300000, gZIPChannel.getTimeout());
        assertEquals("(GZIPChannel) gZIPChannel.getMaxPacketLength()", 100000, gZIPChannel.getMaxPacketLength());
        assertFalse("(GZIPChannel) gZIPChannel.overrideHeader", ((GZIPChannel) gZIPChannel).overrideHeader);
    }
View Full Code Here

    }

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

    @Test
    public void testSendMessageHeaderThrowsNullPointerException1() throws Throwable {
        ISOMsg m = new ISOMsg(100);
        VAPChannel vAPChannel = new VAPChannel(new Base1Packager());
        vAPChannel.setConfiguration(new SimpleConfiguration());
        try {
            vAPChannel.sendMessageHeader(m, 100);
            fail("Expected NullPointerException to be thrown");
        } catch (NullPointerException ex) {
            assertNull("ex.getMessage()", ex.getMessage());
View Full Code Here

    @Test
    public void testSetConfiguration() throws Throwable {
        VAPChannel vAPChannel = new VAPChannel(new Base1Packager());
        vAPChannel.setSocketFactory(new SunJSSESocketFactory());
        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());
View Full Code Here

    }

    @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());
View Full Code Here

        Properties configuration = new Properties();
        configuration.setProperty("file", logRotationTestDirectory.getDirectory().getAbsolutePath() + "/" + logFileName);
        configuration.setProperty("copies", "10");
        configuration.setProperty("maxsize", "1000000");
        logRotationTestDirectory.allowNewFileCreation();
        listener.setConfiguration(new SimpleConfiguration(configuration));
        return listener;
    }
View Full Code Here

    }

    @Test
    public void testSetConfiguration() throws Throwable {
        DelayFilter delayFilter = new DelayFilter(100);
        delayFilter.setConfiguration(new SimpleConfiguration());
        assertEquals("delayFilter.delay", 0, delayFilter.delay);
    }
View Full Code Here

                setMsgValidator( makeMsgValidatorArray( m ) );
            }
            if ( localName.equals( "isofieldvalidator" ) ){
                /** pop properties **/
                Properties p = (Properties)validatorStack.pop();
                SimpleConfiguration cfg = null;
                if ( !p.entrySet().isEmpty() )
                    cfg = new SimpleConfiguration( p );
                /** pop validator and add it to the hash **/
                ISOFieldValidator f = (ISOFieldValidator)validatorStack.pop();
                if ( cfg != null ){
                    try {
                        f.setConfiguration( cfg );
                    }
                    catch (ConfigurationException ex) {
                        ex.printStackTrace(  );
                    }
                }
                ((Map)validatorStack.peek()).put( new Integer(fldID), f );
            }
            if ( localName.equals( "isovalidator" ) ){
                /** pop properties **/
                Properties p = (Properties)validatorStack.pop();
                SimpleConfiguration cfg = null;
                if ( !p.entrySet().isEmpty() )
                    cfg = new SimpleConfiguration( p );
                /** pop validator and add it to the hash **/
                ISOBaseValidator v = (ISOBaseValidator)validatorStack.pop();
                if ( cfg != null ){
                    try {
                        v.setConfiguration( cfg );
View Full Code Here

TOP

Related Classes of org.jpos.core.SimpleConfiguration

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.