Search in sources :

Example 21 with NamesrvController

use of org.apache.rocketmq.namesrv.NamesrvController in project rocketmq by apache.

the class DefaultRequestProcessorTest method init.

@Before
public void init() throws Exception {
    namesrvConfig = new NamesrvConfig();
    nettyServerConfig = new NettyServerConfig();
    routeInfoManager = new RouteInfoManager();
    namesrvController = new NamesrvController(namesrvConfig, nettyServerConfig);
    Field field = NamesrvController.class.getDeclaredField("routeInfoManager");
    field.setAccessible(true);
    field.set(namesrvController, routeInfoManager);
    defaultRequestProcessor = new DefaultRequestProcessor(namesrvController);
    registerRouteInfoManager();
    logger = mock(Logger.class);
    when(logger.isInfoEnabled()).thenReturn(false);
    setFinalStatic(DefaultRequestProcessor.class.getDeclaredField("log"), logger);
}
Also used : Field(java.lang.reflect.Field) NamesrvConfig(org.apache.rocketmq.common.namesrv.NamesrvConfig) RouteInfoManager(org.apache.rocketmq.namesrv.routeinfo.RouteInfoManager) NettyServerConfig(org.apache.rocketmq.remoting.netty.NettyServerConfig) Logger(org.slf4j.Logger) NamesrvController(org.apache.rocketmq.namesrv.NamesrvController) Before(org.junit.Before)

Aggregations

NamesrvController (org.apache.rocketmq.namesrv.NamesrvController)21 NamesrvConfig (org.apache.rocketmq.common.namesrv.NamesrvConfig)20 NettyServerConfig (org.apache.rocketmq.remoting.netty.NettyServerConfig)20 MQClientException (org.apache.rocketmq.client.exception.MQClientException)9 MQBrokerException (org.apache.rocketmq.client.exception.MQBrokerException)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 Field (java.lang.reflect.Field)4 RemotingException (org.apache.rocketmq.remoting.exception.RemotingException)4 Before (org.junit.Before)4 EventDeliveryException (org.apache.flume.EventDeliveryException)3 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 MQClientAPIImpl (org.apache.rocketmq.client.impl.MQClientAPIImpl)2 MQClientInstance (org.apache.rocketmq.client.impl.factory.MQClientInstance)2 BrokerData (org.apache.rocketmq.common.protocol.route.BrokerData)2 TopicRouteData (org.apache.rocketmq.common.protocol.route.TopicRouteData)2 RouteInfoManager (org.apache.rocketmq.namesrv.routeinfo.RouteInfoManager)2 DefaultMQAdminExt (org.apache.rocketmq.tools.admin.DefaultMQAdminExt)2