Search in sources :

Example 6 with CommunicationParam

use of com.alibaba.otter.shared.communication.core.model.CommunicationParam in project otter by alibaba.

the class DubboConnectionTest method testSingle.

@Test
public void testSingle() {
    CommunicationConnectionFactory factory = new DubboCommunicationConnectionFactory();
    CommunicationParam param = new CommunicationParam();
    param.setIp("127.0.0.1");
    param.setPort(2088);
    CommunicationConnection connection = factory.createConnection(param);
    Object result = connection.call(new HeartEvent());
    want.object(result).notNull();
}
Also used : CommunicationConnection(com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnection) HeartEvent(com.alibaba.otter.shared.communication.core.model.heart.HeartEvent) CommunicationParam(com.alibaba.otter.shared.communication.core.model.CommunicationParam) DubboCommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory) CommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionFactory) DubboCommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory) Test(org.testng.annotations.Test)

Aggregations

CommunicationParam (com.alibaba.otter.shared.communication.core.model.CommunicationParam)6 CommunicationConnection (com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnection)5 CommunicationConnectionFactory (com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionFactory)4 Test (org.testng.annotations.Test)4 RmiCommunicationConnectionFactory (com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationConnectionFactory)3 CommunicationException (com.alibaba.otter.shared.communication.core.exception.CommunicationException)2 CommunicationConnectionPoolFactory (com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionPoolFactory)2 RmiCommunicationEndpoint (com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint)2 HeartEvent (com.alibaba.otter.shared.communication.core.model.heart.HeartEvent)2 UnknownHostException (java.net.UnknownHostException)2 DubboCommunicationConnectionFactory (com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory)1 InetAddress (java.net.InetAddress)1 Callable (java.util.concurrent.Callable)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ExecutionException (java.util.concurrent.ExecutionException)1 ExecutorService (java.util.concurrent.ExecutorService)1