test_class.file: shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/test/java/org/apache/shardingsphere/spring/boot/util/DataSourceUtilTest.java
test_class.identifier: DataSourceUtilTest
test_case.body: @Test
      public void assertDataSourceForListValue() throws ReflectiveOperationException {
          Map<String, Object> dataSourceProperties = new HashMap<>(3, 1);
          dataSourceProperties.put("connectionInitSqls", "set names utf8mb4;,set names utf8;");
          BasicDataSource actual = (BasicDataSource) DataSourceUtil.getDataSource(BasicDataSource.class.getName(), dataSourceProperties);
          assertThat(actual.getConnectionInitSqls(), instanceOf(List.class));
          assertThat(actual.getConnectionInitSqls().size(), is(2));
          assertThat(actual.getConnectionInitSqls(), hasItem("set names utf8mb4;"));
          assertThat(actual.getConnectionInitSqls(), hasItem("set names utf8;"));
      }
test_case.class_method_signature: DataSourceUtilTest.assertDataSourceForListValue()
test_case.full_signature: @Test public void assertDataSourceForListValue()
test_case.identifier: assertDataSourceForListValue
test_case.invocations: put getDataSource getName assertThat getConnectionInitSqls instanceOf assertThat size getConnectionInitSqls is assertThat getConnectionInitSqls hasItem assertThat getConnectionInitSqls hasItem
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertDataSourceForListValue()
focal_class.declarator: SET_METHOD_PREFIX = "set"
focal_class.modifier: private static final
focal_class.original_string: private static final String SET_METHOD_PREFIX = "set";
focal_class.type: String
focal_class.var_name: SET_METHOD_PREFIX
focal_class.declarator: GENERAL_CLASS_TYPE
focal_class.modifier: private static final
focal_class.original_string: private static final Collection<Class<?>> GENERAL_CLASS_TYPE;
focal_class.type: Collection<Class<?>>
focal_class.var_name: GENERAL_CLASS_TYPE
focal_class.file: shardingsphere-jdbc/shardingsphere-jdbc-spring/shardingsphere-jdbc-spring-infra/shardingsphere-jdbc-spring-boot-starter-infra/src/main/java/org/apache/shardingsphere/spring/boot/util/DataSourceUtil.java
focal_class.identifier: DataSourceUtil
focal_class.class_method_signature: DataSourceUtil.getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties)
focal_class.full_signature: public static DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties)
focal_class.identifier: getDataSource
focal_class.modifiers: public static
focal_class.parameters: (final String dataSourceClassName, final Map<String, Object> dataSourceProperties)
focal_class.return: DataSource
focal_class.signature: DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties)
focal_class.class_method_signature: DataSourceUtil.getSetterMethodName(final String propertyName)
focal_class.full_signature: private static String getSetterMethodName(final String propertyName)
focal_class.identifier: getSetterMethodName
focal_class.modifiers: private static
focal_class.parameters: (final String propertyName)
focal_class.return: String
focal_class.signature: String getSetterMethodName(final String propertyName)
focal_class.class_method_signature: DataSourceUtil.callSetterMethod(final DataSource dataSource, final String methodName, final String setterValue)
focal_class.full_signature: private static void callSetterMethod(final DataSource dataSource, final String methodName, final String setterValue)
focal_class.identifier: callSetterMethod
focal_class.modifiers: private static
focal_class.parameters: (final DataSource dataSource, final String methodName, final String setterValue)
focal_class.return: void
focal_class.signature: void callSetterMethod(final DataSource dataSource, final String methodName, final String setterValue)
focal_method.body: public static DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties) throws ReflectiveOperationException {
          DataSource result = (DataSource) Class.forName(dataSourceClassName).newInstance();
          for (Entry<String, Object> entry : dataSourceProperties.entrySet()) {
              callSetterMethod(result, getSetterMethodName(entry.getKey()), null == entry.getValue() ? null : entry.getValue().toString());
          }
          return result;
      }
focal_method.class_method_signature: DataSourceUtil.getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties)
focal_method.full_signature: public static DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties)
focal_method.identifier: getDataSource
focal_method.invocations: newInstance forName entrySet callSetterMethod getSetterMethodName getKey getValue toString getValue
focal_method.modifiers: public static
focal_method.parameters: (final String dataSourceClassName, final Map<String, Object> dataSourceProperties)
focal_method.return: DataSource
focal_method.signature: DataSource getDataSource(final String dataSourceClassName, final Map<String, Object> dataSourceProperties)