use of org.apache.dubbo.remoting.exchange.support.ExchangeHandlerDispatcher in project dubbo by alibaba.
the class ExchangersTest method testBind.
@Test
public void testBind() throws RemotingException {
String url = "dubbo://127.0.0.1:12345?exchanger=mockExchanger";
Exchangers.bind(url, Mockito.mock(Replier.class));
Exchangers.bind(url, new ChannelHandlerAdapter(), Mockito.mock(Replier.class));
Exchangers.bind(url, new ExchangeHandlerDispatcher());
Assertions.assertThrows(RuntimeException.class, () -> Exchangers.bind((URL) null, new ExchangeHandlerDispatcher()));
Assertions.assertThrows(RuntimeException.class, () -> Exchangers.bind(url, (ExchangeHandlerDispatcher) null));
}
use of org.apache.dubbo.remoting.exchange.support.ExchangeHandlerDispatcher in project dubbo by alibaba.
the class ExchangersTest method testConnect.
@Test
public void testConnect() throws RemotingException {
String url = "dubbo://127.0.0.1:12345?exchanger=mockExchanger";
Exchangers.connect(url);
Exchangers.connect(url, Mockito.mock(Replier.class));
Exchangers.connect(URL.valueOf(url), Mockito.mock(Replier.class));
Exchangers.connect(url, new ChannelHandlerAdapter(), Mockito.mock(Replier.class));
Exchangers.connect(url, new ExchangeHandlerDispatcher());
Assertions.assertThrows(RuntimeException.class, () -> Exchangers.connect((URL) null, new ExchangeHandlerDispatcher()));
Assertions.assertThrows(RuntimeException.class, () -> Exchangers.connect(url, (ExchangeHandlerDispatcher) null));
}
Aggregations