package io.shardingsphere.core.metadata.datasource;

import io.shardingsphere.core.constant.DatabaseType;
import io.shardingsphere.core.metadata.datasource.dialect.H2DataSourceMetaData;
import io.shardingsphere.core.metadata.datasource.dialect.MySQLDataSourceMetaData;
import io.shardingsphere.core.metadata.datasource.dialect.OracleDataSourceMetaData;
import org.junit.Test;

import static org.junit.Assert.assertTrue;

public class DataSourceMetaDataFactoryTest {
    
    @Test
    public void assertAllNewInstanceForH2() {
        assertTrue((DataSourceMetaDataFactory.newInstance(DatabaseType.H2, "jdbc:h2:mem:ds_0;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=false;MODE=MySQL") instanceof H2DataSourceMetaData));
    }
    
    @Test
    public void assertAllNewInstanceForMySQL() {
        assertTrue((DataSourceMetaDataFactory.newInstance(DatabaseType.MySQL, "jdbc:mysql://127.0.0.1:3306/db_0") instanceof MySQLDataSourceMetaData));
    }
    
    @Test
    public void assertAllNewInstanceForOracle() {
        assertTrue((DataSourceMetaDataFactory.newInstance(DatabaseType.Oracle, "jdbc:oracle:thin:@//127.0.0.1:3306/ds_0") instanceof OracleDataSourceMetaData));
    }
}
@@ -342,24 +342,199 @@
 ceMetaData;%0A
+import io.shardingsphere.core.metadata.datasource.dialect.PostgreSQLDataSourceMetaData;%0Aimport io.shardingsphere.core.metadata.datasource.dialect.SQLServerDataSourceMetaData;%0A
 import org.j
@@ -1338,9 +1338,512 @@
 ;%0A    %7D%0A
+    %0A    @Test%0A    public void assertAllNewInstanceForPostgreSQL() %7B%0A        assertTrue((DataSourceMetaDataFactory.newInstance(DatabaseType.PostgreSQL, %22jdbc:postgresql://127.0.0.1:3306/ds_0%22) instanceof PostgreSQLDataSourceMetaData));%0A    %7D%0A    %0A    @Test%0A    public void assertAllNewInstanceForSQLServer() %7B%0A        assertTrue((DataSourceMetaDataFactory.newInstance(DatabaseType.SQLServer, %22jdbc:microsoft:sqlserver://127.0.0.1:3306;DatabaseName=ds_0%22) instanceof SQLServerDataSourceMetaData));%0A    %7D%0A
 %7D

add assertAllNewInstanceForSQLServer