Search in sources :

Example 16 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)16 NamesrvConfig (org.apache.rocketmq.common.namesrv.NamesrvConfig)15 NettyServerConfig (org.apache.rocketmq.remoting.netty.NettyServerConfig)15 MQClientException (org.apache.rocketmq.client.exception.MQClientException)5 Field (java.lang.reflect.Field)4 Before (org.junit.Before)4 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 EventDeliveryException (org.apache.flume.EventDeliveryException)2 MQBrokerException (org.apache.rocketmq.client.exception.MQBrokerException)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 DefaultMQAdminExtImpl (org.apache.rocketmq.tools.admin.DefaultMQAdminExtImpl)2 BeforeClass (org.junit.BeforeClass)2