Search in sources :

Example 6 with CommunicationConnectionFactory

use of com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionFactory 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

CommunicationConnectionFactory (com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionFactory)6 CommunicationConnection (com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnection)4 CommunicationParam (com.alibaba.otter.shared.communication.core.model.CommunicationParam)4 Test (org.testng.annotations.Test)4 CommunicationConnectionPoolFactory (com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionPoolFactory)3 RmiCommunicationConnectionFactory (com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationConnectionFactory)3 DubboCommunicationConnectionFactory (com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory)2 RmiCommunicationEndpoint (com.alibaba.otter.shared.communication.core.impl.rmi.RmiCommunicationEndpoint)2 HeartEvent (com.alibaba.otter.shared.communication.core.model.heart.HeartEvent)2 DefaultCommunicationClientImpl (com.alibaba.otter.shared.communication.core.impl.DefaultCommunicationClientImpl)1 DubboCommunicationEndpoint (com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationEndpoint)1 Callable (java.util.concurrent.Callable)1 CountDownLatch (java.util.concurrent.CountDownLatch)1 ExecutorService (java.util.concurrent.ExecutorService)1 BeforeClass (org.testng.annotations.BeforeClass)1