test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/complex/ShardingComplexRoutingEngineTest.java
test_class.identifier: ShardingComplexRoutingEngineTest
test_class.superclass: extends AbstractRoutingEngineTest
test_case.body: @Test(expected = ShardingSphereException.class)
      public void assertRoutingForNonLogicTable() {
          ShardingComplexRoutingEngine complexRoutingEngine = new ShardingComplexRoutingEngine(Collections.emptyList(), 
                  createShardingConditions("t_order"), new ConfigurationProperties(new Properties()));
          RouteContext routeContext = new RouteContext();
          complexRoutingEngine.route(routeContext, mock(ShardingRule.class));
      }
test_case.class_method_signature: ShardingComplexRoutingEngineTest.assertRoutingForNonLogicTable()
test_case.full_signature: @Test(expected = ShardingSphereException.class) public void assertRoutingForNonLogicTable()
test_case.identifier: assertRoutingForNonLogicTable
test_case.invocations: emptyList createShardingConditions route mock
test_case.modifiers: @Test(expected = ShardingSphereException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertRoutingForNonLogicTable()
focal_class.declarator: logicTables
focal_class.modifier: private final
focal_class.original_string: private final Collection<String> logicTables;
focal_class.type: Collection<String>
focal_class.var_name: logicTables
focal_class.declarator: shardingConditions
focal_class.modifier: private final
focal_class.original_string: private final ShardingConditions shardingConditions;
focal_class.type: ShardingConditions
focal_class.var_name: shardingConditions
focal_class.declarator: props
focal_class.modifier: private final
focal_class.original_string: private final ConfigurationProperties props;
focal_class.type: ConfigurationProperties
focal_class.var_name: props
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/complex/ShardingComplexRoutingEngine.java
focal_class.identifier: ShardingComplexRoutingEngine
focal_class.interfaces: implements ShardingRouteEngine
focal_class.class_method_signature: ShardingComplexRoutingEngine.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_method.body: @Override
      public void route(final RouteContext routeContext, final ShardingRule shardingRule) {
          Collection<String> bindingTableNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
          Collection<RouteContext> routeContexts = new ArrayList<>(logicTables.size());
          for (String each : logicTables) {
              RouteContext newRouteContext = new RouteContext();
              Optional<TableRule> tableRule = shardingRule.findTableRule(each);
              if (tableRule.isPresent()) {
                  if (!bindingTableNames.contains(each)) {
                      new ShardingStandardRoutingEngine(tableRule.get().getLogicTable(), shardingConditions, props).route(newRouteContext, shardingRule);
                      routeContexts.add(newRouteContext);
                  }
                  shardingRule.findBindingTableRule(each).ifPresent(bindingTableRule -> bindingTableNames.addAll(
                      bindingTableRule.getTableRules().stream().map(TableRule::getLogicTable).collect(Collectors.toList())));
              }
          }
          if (routeContexts.isEmpty()) {
              throw new ShardingSphereException("Cannot find table rule and default data source with logic tables: '%s'", logicTables);
          }
          if (1 == routeContexts.size()) {
              RouteContext newRouteContext = routeContexts.iterator().next();
              routeContext.getOriginalDataNodes().addAll(newRouteContext.getOriginalDataNodes());
              routeContext.getRouteUnits().addAll(newRouteContext.getRouteUnits());
              return;
          }
          RouteContext newRouteContext = new RouteContext();
          new ShardingCartesianRoutingEngine(routeContexts).route(newRouteContext, shardingRule);
          routeContext.getOriginalDataNodes().addAll(newRouteContext.getOriginalDataNodes());
          routeContext.getRouteUnits().addAll(newRouteContext.getRouteUnits());
      }
focal_method.class_method_signature: ShardingComplexRoutingEngine.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: size findTableRule isPresent contains route getLogicTable get add ifPresent findBindingTableRule addAll collect map stream getTableRules toList isEmpty size next iterator addAll getOriginalDataNodes getOriginalDataNodes addAll getRouteUnits getRouteUnits route addAll getOriginalDataNodes getOriginalDataNodes addAll getRouteUnits getRouteUnits
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)