test_class.declarator: shardingDataSourceGroupBroadcastRoutingEngine = new ShardingDataSourceGroupBroadcastRoutingEngine()
test_class.modifier: private final
test_class.original_string: private final ShardingDataSourceGroupBroadcastRoutingEngine shardingDataSourceGroupBroadcastRoutingEngine = new ShardingDataSourceGroupBroadcastRoutingEngine();
test_class.type: ShardingDataSourceGroupBroadcastRoutingEngine
test_class.var_name: shardingDataSourceGroupBroadcastRoutingEngine
test_class.declarator: shardingRule
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ShardingRule shardingRule;
test_class.type: ShardingRule
test_class.var_name: shardingRule
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingDataSourceGroupBroadcastRoutingEngineTest.java
test_class.identifier: ShardingDataSourceGroupBroadcastRoutingEngineTest
test_case.body: @Test
      public void assertRoute() {
          List<List<String>> shards = new LinkedList<>();
          shards.add(Arrays.asList("ds1", "ds2", "ds3"));
          shards.add(Arrays.asList("ds1", "ds2", "ds3"));
          shards.add(Arrays.asList("ds1", "ds2", "ds3"));
          List<TableRule> tableRules = mockTableRules(shards);
          when(shardingRule.getTableRules()).thenReturn(tableRules);
          RouteContext routeContext = new RouteContext();
          shardingDataSourceGroupBroadcastRoutingEngine.route(routeContext, shardingRule);
          assertThat(routeContext.getRouteUnits().size(), is(1));
          Iterator<RouteUnit> iterator = routeContext.getRouteUnits().iterator();
          assertThat(Arrays.asList("ds1", "ds2", "ds3"), hasItems(iterator.next().getDataSourceMapper().getActualName()));
      }
test_case.class_method_signature: ShardingDataSourceGroupBroadcastRoutingEngineTest.assertRoute()
test_case.full_signature: @Test public void assertRoute()
test_case.identifier: assertRoute
test_case.invocations: add asList add asList add asList mockTableRules thenReturn when getTableRules route assertThat size getRouteUnits is iterator getRouteUnits assertThat asList hasItems getActualName getDataSourceMapper next
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertRoute()
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/broadcast/ShardingDataSourceGroupBroadcastRoutingEngine.java
focal_class.identifier: ShardingDataSourceGroupBroadcastRoutingEngine
focal_class.interfaces: implements ShardingRouteEngine
focal_class.class_method_signature: ShardingDataSourceGroupBroadcastRoutingEngine.route(final RouteContext routeContext, final ShardingRule shardingRule)
focal_class.full_signature: @Override public void route(final RouteContext routeContext, final ShardingRule shardingRule)
focal_class.identifier: route
focal_class.modifiers: @Override public
focal_class.parameters: (final RouteContext routeContext, final ShardingRule shardingRule)
focal_class.return: void
focal_class.signature: void route(final RouteContext routeContext, final ShardingRule shardingRule)
focal_class.class_method_signature: ShardingDataSourceGroupBroadcastRoutingEngine.getBroadcastDataSourceGroup(final Collection<Set<String>> dataSourceGroup)
focal_class.full_signature: private Collection<Set<String>> getBroadcastDataSourceGroup(final Collection<Set<String>> dataSourceGroup)
focal_class.identifier: getBroadcastDataSourceGroup
focal_class.modifiers: private
focal_class.parameters: (final Collection<Set<String>> dataSourceGroup)
focal_class.return: Collection<Set<String>>
focal_class.signature: Collection<Set<String>> getBroadcastDataSourceGroup(final Collection<Set<String>> dataSourceGroup)
focal_class.class_method_signature: ShardingDataSourceGroupBroadcastRoutingEngine.getDataSourceGroup(final ShardingRule shardingRule)
focal_class.full_signature: private Collection<Set<String>> getDataSourceGroup(final ShardingRule shardingRule)
focal_class.identifier: getDataSourceGroup
focal_class.modifiers: private
focal_class.parameters: (final ShardingRule shardingRule)
focal_class.return: Collection<Set<String>>
focal_class.signature: Collection<Set<String>> getDataSourceGroup(final ShardingRule shardingRule)
focal_class.class_method_signature: ShardingDataSourceGroupBroadcastRoutingEngine.getCandidateDataSourceGroup(final Collection<Set<String>> dataSourceSetGroup, final Set<String> compareSet)
focal_class.full_signature: private Collection<Set<String>> getCandidateDataSourceGroup(final Collection<Set<String>> dataSourceSetGroup, final Set<String> compareSet)
focal_class.identifier: getCandidateDataSourceGroup
focal_class.modifiers: private
focal_class.parameters: (final Collection<Set<String>> dataSourceSetGroup, final Set<String> compareSet)
focal_class.return: Collection<Set<String>>
focal_class.signature: Collection<Set<String>> getCandidateDataSourceGroup(final Collection<Set<String>> dataSourceSetGroup, final Set<String> compareSet)
focal_class.class_method_signature: ShardingDataSourceGroupBroadcastRoutingEngine.getRandomDataSourceName(final Collection<String> dataSourceNames)
focal_class.full_signature: private String getRandomDataSourceName(final Collection<String> dataSourceNames)
focal_class.identifier: getRandomDataSourceName
focal_class.modifiers: private
focal_class.parameters: (final Collection<String> dataSourceNames)
focal_class.return: String
focal_class.signature: String getRandomDataSourceName(final Collection<String> dataSourceNames)
focal_method.body: @Override
      public void route(final RouteContext routeContext, final ShardingRule shardingRule) {
          Collection<Set<String>> broadcastDataSourceGroup = getBroadcastDataSourceGroup(getDataSourceGroup(shardingRule));
          for (Set<String> each : broadcastDataSourceGroup) {
              String dataSourceName = getRandomDataSourceName(each);
              routeContext.getRouteUnits().add(new RouteUnit(new RouteMapper(dataSourceName, dataSourceName), Collections.emptyList()));
          }
      }
focal_method.class_method_signature: ShardingDataSourceGroupBroadcastRoutingEngine.route(final RouteContext routeContext, final ShardingRule shardingRule)
focal_method.full_signature: @Override public void route(final RouteContext routeContext, final ShardingRule shardingRule)
focal_method.identifier: route
focal_method.invocations: getBroadcastDataSourceGroup getDataSourceGroup getRandomDataSourceName add getRouteUnits emptyList
focal_method.modifiers: @Override public
focal_method.parameters: (final RouteContext routeContext, final ShardingRule shardingRule)
focal_method.return: void
focal_method.signature: void route(final RouteContext routeContext, final ShardingRule shardingRule)