use of co.cask.cdap.route.store.RouteStore in project cdap by caskdata.
the class RoutingToDataSetsTest method before.
@BeforeClass
public static void before() throws Exception {
CConfiguration cConf = CConfiguration.create();
Injector injector = Guice.createInjector(new SecurityModules().getInMemoryModules(), new DiscoveryRuntimeModule().getInMemoryModules(), new AppFabricTestModule(cConf));
// Starting router
DiscoveryServiceClient discoveryServiceClient = injector.getInstance(DiscoveryServiceClient.class);
AccessTokenTransformer accessTokenTransformer = injector.getInstance(AccessTokenTransformer.class);
RouteStore routeStore = injector.getInstance(RouteStore.class);
SConfiguration sConf = SConfiguration.create();
cConf.set(Constants.Router.ADDRESS, "localhost");
port = Networks.getRandomPort();
cConf.setInt(Constants.Router.ROUTER_PORT, port);
nettyRouter = new NettyRouter(cConf, sConf, InetAddresses.forString("127.0.0.1"), new RouterServiceLookup(cConf, discoveryServiceClient, new RouterPathLookup(), routeStore), new SuccessTokenValidator(), accessTokenTransformer, discoveryServiceClient);
nettyRouter.startAndWait();
// Starting mock DataSet service
DiscoveryService discoveryService = injector.getInstance(DiscoveryService.class);
mockService = new MockHttpService(discoveryService, Constants.Service.DATASET_MANAGER, new MockDatasetTypeHandler(), new MockDatasetInstanceHandler());
mockService.startAndWait();
}
Aggregations