Search in sources :

Example 6 with ConnectionOrderedChannelHandler

use of org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedChannelHandler in project dubbo by alibaba.

the class ConnectChannelHandlerTest method test_Disconnect_Biz_Error.

// biz error should not throw and affect biz thread.
@Test
public void test_Disconnect_Biz_Error() throws RemotingException {
    handler = new ConnectionOrderedChannelHandler(new BizChannelHander(true), url);
    handler.disconnected(new MockedChannel());
}
Also used : ConnectionOrderedChannelHandler(org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedChannelHandler) Test(org.junit.jupiter.api.Test)

Example 7 with ConnectionOrderedChannelHandler

use of org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedChannelHandler in project dubbo by alibaba.

the class ConnectChannelHandlerTest method test_Disconnect_Execute_Error.

@Test
public void test_Disconnect_Execute_Error() throws RemotingException {
    Assertions.assertThrows(ExecutionException.class, () -> {
        handler = new ConnectionOrderedChannelHandler(new BizChannelHander(false), url);
        ThreadPoolExecutor executor = (ThreadPoolExecutor) getField(handler, "connectionExecutor", 1);
        executor.shutdown();
        handler.disconnected(new MockedChannel());
    });
}
Also used : ThreadPoolExecutor(java.util.concurrent.ThreadPoolExecutor) ConnectionOrderedChannelHandler(org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedChannelHandler) Test(org.junit.jupiter.api.Test)

Aggregations

ConnectionOrderedChannelHandler (org.apache.dubbo.remoting.transport.dispatcher.connection.ConnectionOrderedChannelHandler)7 Test (org.junit.jupiter.api.Test)7 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)5 Disabled (org.junit.jupiter.api.Disabled)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)1 RemotingException (org.apache.dubbo.remoting.RemotingException)1 Request (org.apache.dubbo.remoting.exchange.Request)1 Response (org.apache.dubbo.remoting.exchange.Response)1