Package de.netseeker.ejoe.cltest

Source Code of de.netseeker.ejoe.cltest.BaseRemoteClientTest

/*********************************************************************
* BaseRemoteClientTest.java
* created on 09.03.2005 by netseeker
* $Source: /cvsroot/ejoe/EJOE/cltest/de/netseeker/ejoe/cltest/BaseRemoteClientTest.java,v $
* $Date: 2007/03/22 21:01:36 $
* $Revision: 1.10 $
*********************************************************************/
package de.netseeker.ejoe.cltest;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;

import junit.framework.TestCase;
import de.netseeker.ejoe.EJClient;
import de.netseeker.ejoe.EJConstants;
import de.netseeker.ejoe.adapter.XStreamAdapter;

/**
* @author netseeker
*/
public class BaseRemoteClientTest extends TestCase
{
    private static final Logger log = Logger.getLogger( BaseRemoteClientTest.class.getName() );

    private EJClient            client;

    /*
     * @see BaseTest#setUp()
     */
    protected void setUp() throws Exception
    {
        super.setUp();
        client = new EJClient( "127.0.0.1", EJConstants.EJOE_PORT,
                               new XStreamAdapter( true ) );
        client.enableRemoteClassloading();
        client.enablePersistentConnection( true );
    }

    public void testExecute()
    {
        Map input = new HashMap();
        input.put( "KEY1", "Hello" );
        input.put( "KEY2", new Integer( 101 ) );
        input.put( "KEY3", BigDecimal.valueOf( 102 ) );

        try
        {
            Map result = (Map) client.execute( input );
            for ( Iterator it = result.keySet().iterator(); it.hasNext(); )
            {
                String key = (String) it.next();
                log.log( Level.INFO, key + ": " + result.get( key ) );
            }
        }
        catch ( IOException e )
        {
            e.printStackTrace();
        }
    }
}
TOP

Related Classes of de.netseeker.ejoe.cltest.BaseRemoteClientTest

TOP
Copyright © 2018 www.massapi.com. 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.