use of com.ctrip.platform.dal.dao.datasource.cluster.strategy.multi.ob.OBStrategy in project dal by ctripcorp.
the class MultiHostClusterPropertiesAdapterTest method getRouteStrategy.
@Test
public void getRouteStrategy() {
clusterPropertiesAdapter = new MultiHostClusterPropertiesAdapter(mgrRouteStrategyConfig, CLUSTER_NAME);
String routeStrategy = clusterPropertiesAdapter.routeStrategyName();
Assert.assertEquals(RouteStrategyEnum.WRITE_ORDERED.name(), routeStrategy);
RouteStrategy multiHostStrategy = clusterPropertiesAdapter.generate();
Assert.assertTrue(multiHostStrategy instanceof MGRStrategy);
clusterPropertiesAdapter = new MultiHostClusterPropertiesAdapter(obRouteStrategyConfig, CLUSTER_NAME);
routeStrategy = clusterPropertiesAdapter.routeStrategyName();
Assert.assertEquals(RouteStrategyEnum.WRITE_CURRENT_ZONE_FIRST.getAlias(), routeStrategy);
multiHostStrategy = clusterPropertiesAdapter.generate();
Assert.assertTrue(multiHostStrategy instanceof OBStrategy);
clusterPropertiesAdapter = new MultiHostClusterPropertiesAdapter(mgrRouteStrategyConfig, CLUSTER_NAME);
}
Aggregations