Package org.jacorb.test.transport

Source Code of org.jacorb.test.transport.IIOPTester

package org.jacorb.test.transport;

import junit.framework.Assert;

import org.slf4j.Logger;
import org.jacorb.transport.iiop.Current;
import org.jacorb.transport.iiop.CurrentHelper;
import org.omg.CORBA.ORB;
import org.omg.CORBA.Object;


public class IIOPTester implements AbstractTester {
    public void test_transport_current(ORB orb, Logger logger) {

        try {
            // Get the Current object.
            Object tcobject = orb.resolve_initial_references ("JacOrbIIOPTransportCurrent");

            Current tc = CurrentHelper.narrow (tcobject);
           
            logger.info("TC: ["+tc.id()+"] from="+tc.local_host() +":"+tc.local_port() +", to="
                        +tc.remote_host()+":"+tc.remote_port());

            logger.info("TC: ["+tc.id()+"] sent="+tc.messages_sent ()+"("+tc.bytes_sent ()+")"
                        +", received="+tc.messages_received ()+"("+tc.bytes_received ()+")");
        }
        catch (Exception ex) {
            ex.printStackTrace ();
            Assert.fail ("Unexpected exception" + ex);
        }
    }


}
TOP

Related Classes of org.jacorb.test.transport.IIOPTester

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.