You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2020/03/02 01:39:16 UTC

[GitHub] [incubator-shardingsphere] kimmking commented on a change in pull request #4545: Issue2010

kimmking commented on a change in pull request #4545: Issue2010
URL: https://github.com/apache/incubator-shardingsphere/pull/4545#discussion_r386165802
 
 

 ##########
 File path: shardingsphere-underlying/shardingsphere-common/src/test/java/org/apache/shardingsphere/underlying/common/config/DataSourceConfigurationTest.java
 ##########
 @@ -83,4 +88,25 @@ public void assertAddAlias() {
         assertThat(actual.getProperties().get("jdbcUrl"), is(actual.getProperties().get("url")));
         assertThat(actual.getProperties().get("username"), is(actual.getProperties().get("user")));
     }
+    
+    @Test
+    public void assertGetDataSourceConfigurationWithConnectionInitSqls() throws SQLException {
 
 Review comment:
   Here is a integration test.
   I suggestion:
   1. if do this way, it's neccesary to use HikariDataSource instead of BasicDatasource.
   2. creat a table in h2 db, and set an insert sql to initSql, then check it work well by a select and compare.
   
   Or anothor approach: 
   just mock a jdbc driver behind HikariDataSource, check hikariDataSource send the initSql to mock jdbc connection/statement.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services