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.declarator: shardingSphereMetaData
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ShardingSphereMetaData shardingSphereMetaData;
test_class.type: ShardingSphereMetaData
test_class.var_name: shardingSphereMetaData
test_class.declarator: sqlStatementContext
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private SQLStatementContext sqlStatementContext;
test_class.type: SQLStatementContext
test_class.var_name: sqlStatementContext
test_class.declarator: tablesContext
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private TablesContext tablesContext;
test_class.type: TablesContext
test_class.var_name: tablesContext
test_class.declarator: shardingConditions
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ShardingConditions shardingConditions;
test_class.type: ShardingConditions
test_class.var_name: shardingConditions
test_class.declarator: tableNames
test_class.modifier: private
test_class.original_string: private Collection<String> tableNames;
test_class.type: Collection<String>
test_class.var_name: tableNames
test_class.declarator: props = new ConfigurationProperties(new Properties())
test_class.modifier: private final
test_class.original_string: private final ConfigurationProperties props = new ConfigurationProperties(new Properties());
test_class.type: ConfigurationProperties
test_class.var_name: props
test_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/test/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactoryTest.java
test_class.identifier: ShardingRouteEngineFactoryTest
test_case.body: @Test
      public void assertNewInstanceForDALWithTables() {
          tableNames.add("tbl");
          when(shardingRule.tableRuleExists(tableNames)).thenReturn(true);
          DALStatement dalStatement = mock(DALStatement.class);
          when(sqlStatementContext.getSqlStatement()).thenReturn(dalStatement);
          ShardingRouteEngine actual = ShardingRouteEngineFactory.newInstance(shardingRule, shardingSphereMetaData, sqlStatementContext, shardingConditions, props);
          assertThat(actual, instanceOf(ShardingUnicastRoutingEngine.class));
      }
test_case.class_method_signature: ShardingRouteEngineFactoryTest.assertNewInstanceForDALWithTables()
test_case.full_signature: @Test public void assertNewInstanceForDALWithTables()
test_case.identifier: assertNewInstanceForDALWithTables
test_case.invocations: add thenReturn when tableRuleExists mock thenReturn when getSqlStatement newInstance assertThat instanceOf
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertNewInstanceForDALWithTables()
focal_class.file: shardingsphere-features/shardingsphere-sharding/shardingsphere-sharding-route/src/main/java/org/apache/shardingsphere/sharding/route/engine/type/ShardingRouteEngineFactory.java
focal_class.identifier: ShardingRouteEngineFactory
focal_class.class_method_signature: ShardingRouteEngineFactory.newInstance(final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props)
focal_class.full_signature: public static ShardingRouteEngine newInstance(final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props)
focal_class.identifier: newInstance
focal_class.modifiers: public static
focal_class.parameters: (final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props)
focal_class.return: ShardingRouteEngine
focal_class.signature: ShardingRouteEngine newInstance(final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props)
focal_class.class_method_signature: ShardingRouteEngineFactory.getDALRoutingEngine(final ShardingRule shardingRule, 
                                                             final Map<String, Collection<String>> unconfiguredSchemaMetaDataMap, final SQLStatement sqlStatement, final Collection<String> tableNames)
focal_class.full_signature: private static ShardingRouteEngine getDALRoutingEngine(final ShardingRule shardingRule, 
                                                             final Map<String, Collection<String>> unconfiguredSchemaMetaDataMap, final SQLStatement sqlStatement, final Collection<String> tableNames)
focal_class.identifier: getDALRoutingEngine
focal_class.modifiers: private static
focal_class.parameters: (final ShardingRule shardingRule, 
                                                             final Map<String, Collection<String>> unconfiguredSchemaMetaDataMap, final SQLStatement sqlStatement, final Collection<String> tableNames)
focal_class.return: ShardingRouteEngine
focal_class.signature: ShardingRouteEngine getDALRoutingEngine(final ShardingRule shardingRule, 
                                                             final Map<String, Collection<String>> unconfiguredSchemaMetaDataMap, final SQLStatement sqlStatement, final Collection<String> tableNames)
focal_class.class_method_signature: ShardingRouteEngineFactory.getDCLRoutingEngine(final SQLStatementContext sqlStatementContext, final ShardingSphereMetaData metaData)
focal_class.full_signature: private static ShardingRouteEngine getDCLRoutingEngine(final SQLStatementContext sqlStatementContext, final ShardingSphereMetaData metaData)
focal_class.identifier: getDCLRoutingEngine
focal_class.modifiers: private static
focal_class.parameters: (final SQLStatementContext sqlStatementContext, final ShardingSphereMetaData metaData)
focal_class.return: ShardingRouteEngine
focal_class.signature: ShardingRouteEngine getDCLRoutingEngine(final SQLStatementContext sqlStatementContext, final ShardingSphereMetaData metaData)
focal_class.class_method_signature: ShardingRouteEngineFactory.isDCLForSingleTable(final SQLStatementContext sqlStatementContext)
focal_class.full_signature: private static boolean isDCLForSingleTable(final SQLStatementContext sqlStatementContext)
focal_class.identifier: isDCLForSingleTable
focal_class.modifiers: private static
focal_class.parameters: (final SQLStatementContext sqlStatementContext)
focal_class.return: boolean
focal_class.signature: boolean isDCLForSingleTable(final SQLStatementContext sqlStatementContext)
focal_class.class_method_signature: ShardingRouteEngineFactory.getShardingRoutingEngine(final ShardingRule shardingRule, final ShardingConditions shardingConditions, 
                                                                  final Collection<String> tableNames, final ConfigurationProperties props)
focal_class.full_signature: private static ShardingRouteEngine getShardingRoutingEngine(final ShardingRule shardingRule, final ShardingConditions shardingConditions, 
                                                                  final Collection<String> tableNames, final ConfigurationProperties props)
focal_class.identifier: getShardingRoutingEngine
focal_class.modifiers: private static
focal_class.parameters: (final ShardingRule shardingRule, final ShardingConditions shardingConditions, 
                                                                  final Collection<String> tableNames, final ConfigurationProperties props)
focal_class.return: ShardingRouteEngine
focal_class.signature: ShardingRouteEngine getShardingRoutingEngine(final ShardingRule shardingRule, final ShardingConditions shardingConditions, 
                                                                  final Collection<String> tableNames, final ConfigurationProperties props)
focal_method.body: public static ShardingRouteEngine newInstance(final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props) {
          SQLStatement sqlStatement = sqlStatementContext.getSqlStatement();
          Collection<String> tableNames = sqlStatementContext.getTablesContext().getTableNames();
          if (sqlStatement instanceof TCLStatement) {
              return new ShardingDatabaseBroadcastRoutingEngine();
          }
          if (sqlStatement instanceof DDLStatement) {
              return new ShardingTableBroadcastRoutingEngine(metaData.getRuleSchemaMetaData().getConfiguredSchemaMetaData(), sqlStatementContext);
          }
          if (sqlStatement instanceof DALStatement) {
              return getDALRoutingEngine(shardingRule, metaData.getRuleSchemaMetaData().getUnconfiguredSchemaMetaDataMap(), sqlStatement, tableNames);
          }
          if (sqlStatement instanceof DCLStatement) {
              return getDCLRoutingEngine(sqlStatementContext, metaData);
          }
          if (shardingRule.isAllBroadcastTables(tableNames)) {
              return sqlStatement instanceof SelectStatement ? new ShardingUnicastRoutingEngine(tableNames) : new ShardingDatabaseBroadcastRoutingEngine();
          }
          if (sqlStatementContext.getSqlStatement() instanceof DMLStatement && shardingConditions.isAlwaysFalse() || tableNames.isEmpty()) {
              return new ShardingUnicastRoutingEngine(tableNames);
          }
          if (!shardingRule.tableRuleExists(tableNames)) {
              return new ShardingUnconfiguredTablesRoutingEngine(tableNames, metaData.getRuleSchemaMetaData().getUnconfiguredSchemaMetaDataMap());
          }
          return getShardingRoutingEngine(shardingRule, shardingConditions, tableNames, props);
      }
focal_method.class_method_signature: ShardingRouteEngineFactory.newInstance(final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props)
focal_method.full_signature: public static ShardingRouteEngine newInstance(final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props)
focal_method.identifier: newInstance
focal_method.invocations: getSqlStatement getTableNames getTablesContext getConfiguredSchemaMetaData getRuleSchemaMetaData getDALRoutingEngine getUnconfiguredSchemaMetaDataMap getRuleSchemaMetaData getDCLRoutingEngine isAllBroadcastTables getSqlStatement isAlwaysFalse isEmpty tableRuleExists getUnconfiguredSchemaMetaDataMap getRuleSchemaMetaData getShardingRoutingEngine
focal_method.modifiers: public static
focal_method.parameters: (final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props)
focal_method.return: ShardingRouteEngine
focal_method.signature: ShardingRouteEngine newInstance(final ShardingRule shardingRule, final ShardingSphereMetaData metaData, 
                                                    final SQLStatementContext sqlStatementContext, final ShardingConditions shardingConditions, final ConfigurationProperties props)