use of org.apache.rocketmq.common.namesrv.NamesrvConfig in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
the class NamesrvControllerTest method testRestart.
/**
* Tests if the controller can be properly stopped and started.
*
* @throws Exception If fails.
*/
@Test
public void testRestart() throws Exception {
for (int i = 0; i < RESTARTNUM; i++) {
NamesrvController namesrvController = new NamesrvController(new NamesrvConfig(), new NettyServerConfig());
boolean initResult = namesrvController.initialize();
assertThat(initResult).isEqualTo(true);
namesrvController.start();
namesrvController.shutdown();
}
}
use of org.apache.rocketmq.common.namesrv.NamesrvConfig in project rocketmq-rocketmq-all-4.1.0-incubating by lirenzuo.
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);
}
use of org.apache.rocketmq.common.namesrv.NamesrvConfig 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);
}
Aggregations