Search in sources :

Example 1 with DubboCommunicationConnectionFactory

use of com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory in project otter by alibaba.

the class DubboCommunicationTest method initial.

@BeforeClass
public void initial() {
    DubboCommunicationEndpoint endpoint2088 = new DubboCommunicationEndpoint(2088);
    endpoint2088.initial();
    DubboCommunicationEndpoint endpoint2089 = new DubboCommunicationEndpoint(2089);
    endpoint2089.initial();
    CommunicationConnectionFactory factory = new DubboCommunicationConnectionFactory();
    client = new DefaultCommunicationClientImpl(factory);
    client.initial();
}
Also used : DubboCommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory) DubboCommunicationEndpoint(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationEndpoint) DefaultCommunicationClientImpl(com.alibaba.otter.shared.communication.core.impl.DefaultCommunicationClientImpl) CommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnectionFactory) DubboCommunicationConnectionFactory(com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with DubboCommunicationConnectionFactory

use of com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory 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)2 DubboCommunicationConnectionFactory (com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationConnectionFactory)2 DefaultCommunicationClientImpl (com.alibaba.otter.shared.communication.core.impl.DefaultCommunicationClientImpl)1 CommunicationConnection (com.alibaba.otter.shared.communication.core.impl.connection.CommunicationConnection)1 DubboCommunicationEndpoint (com.alibaba.otter.shared.communication.core.impl.dubbo.DubboCommunicationEndpoint)1 CommunicationParam (com.alibaba.otter.shared.communication.core.model.CommunicationParam)1 HeartEvent (com.alibaba.otter.shared.communication.core.model.heart.HeartEvent)1 BeforeClass (org.testng.annotations.BeforeClass)1 Test (org.testng.annotations.Test)1