test_class.declarator: shardingDefaultDatabaseRoutingEngine
test_class.modifier: private
test_class.original_string: private ShardingUnconfiguredTablesRoutingEngine shardingDefaultDatabaseRoutingEngine;
test_class.type: ShardingUnconfiguredTablesRoutingEngine
test_class.var_name: shardingDefaultDatabaseRoutingEngine
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/unconfigured/ShardingUnconfiguredTablesRoutingEngineTest.java
test_class.identifier: ShardingUnconfiguredTablesRoutingEngineTest
test_case.body: @Test
      public void assertRoute() {
          ShardingRuleConfiguration shardingRuleConfig = new ShardingRuleConfiguration();
          ShardingRule shardingRule = new ShardingRule(shardingRuleConfig, Arrays.asList("ds_0", "ds_1"));
          RouteContext routeContext = new RouteContext();
          shardingDefaultDatabaseRoutingEngine.route(routeContext, shardingRule);
          List<RouteUnit> routeUnits = new ArrayList<>(routeContext.getRouteUnits());
          assertThat(routeContext.getRouteUnits().size(), is(1));
          assertThat(routeUnits.get(0).getDataSourceMapper().getActualName(), is("ds_0"));
          assertThat(routeUnits.get(0).getTableMappers().size(), is(2));
          Iterator<RouteMapper> tableMappers = routeUnits.get(0).getTableMappers().iterator();
          RouteMapper tableMapper0 = tableMappers.next();
          assertThat(tableMapper0.getActualName(), is("t_order"));
          assertThat(tableMapper0.getLogicName(), is("t_order"));
          RouteMapper tableMapper1 = tableMappers.next();
          assertThat(tableMapper1.getActualName(), is("t_order_item"));
          assertThat(tableMapper1.getLogicName(), is("t_order_item"));
      }
test_case.class_method_signature: ShardingUnconfiguredTablesRoutingEngineTest.assertRoute()
test_case.full_signature: @Test public void assertRoute()
test_case.identifier: assertRoute
test_case.invocations: asList route getRouteUnits assertThat size getRouteUnits is assertThat getActualName getDataSourceMapper get is assertThat size getTableMappers get is iterator getTableMappers get next assertThat getActualName is assertThat getLogicName is next assertThat getActualName is assertThat getLogicName is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertRoute()
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: unconfiguredSchemaMetaDataMap
focal_class.modifier: private final
focal_class.original_string: private final Map<String, Collection<String>> unconfiguredSchemaMetaDataMap;
focal_class.type: Map<String, Collection<String>>
focal_class.var_name: unconfiguredSchemaMetaDataMap
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/unconfigured/ShardingUnconfiguredTablesRoutingEngine.java
focal_class.identifier: ShardingUnconfiguredTablesRoutingEngine
focal_class.interfaces: implements ShardingRouteEngine
focal_class.class_method_signature: ShardingUnconfiguredTablesRoutingEngine.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: ShardingUnconfiguredTablesRoutingEngine.findDataSourceName()
focal_class.full_signature: private Optional<String> findDataSourceName()
focal_class.identifier: findDataSourceName
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Optional<String>
focal_class.signature: Optional<String> findDataSourceName()
focal_method.body: @Override
      public void route(final RouteContext routeContext, final ShardingRule shardingRule) {
          Optional<String> dataSourceName = findDataSourceName();
          if (!dataSourceName.isPresent()) {
              throw new ShardingSphereException("Can not route tables for `%s`, please make sure the tables are in same schema.", logicTables);
          }
          List<RouteMapper> routingTables = logicTables.stream().map(table -> new RouteMapper(table, table)).collect(Collectors.toList());
          routeContext.getRouteUnits().add(new RouteUnit(new RouteMapper(dataSourceName.get(), dataSourceName.get()), routingTables));
      }
focal_method.class_method_signature: ShardingUnconfiguredTablesRoutingEngine.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: findDataSourceName isPresent collect map stream toList add getRouteUnits get get
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)