public static DataSourceProxyConfig parseConfig(String url, Properties info) throws SQLException {
        String restUrl = url.substring(DEFAULT_PREFIX.length());
        DataSourceProxyConfig config = new DataSourceProxyConfig();
        int colonPos = -1;
        while ((colonPos = restUrl.indexOf(":")) != -1)
        {
            if (restUrl.startsWith("jdbc:")) {
                break;
            }
            if (restUrl.indexOf("=") == -1) {
                break;
            }
            String fragmentText = restUrl.substring(0, colonPos);
            int equalPos = fragmentText.indexOf("=");
            if (equalPos == -1)
            {
                continue;
            }
            String key = fragmentText.substring(0, equalPos + 1);
            String value = fragmentText.substring(equalPos + 1);
            if (StringUtils.equalsIgnoreCase(key, DRIVER_PREFIX))
            {
                config.setRawDriverClassName(value.trim());
            }
            else if (StringUtils.equalsIgnoreCase(key, FILTERS_PREFIX))
            {
                for (String filterItem : value.split(",")) {
                    FilterManager.loadFilter(config.getFilters(), filterItem);
                }
            }
            else if (StringUtils.equalsIgnoreCase(key, NAME_PREFIX))
            {
                config.setName(value);
            }
            else if (StringUtils.equalsIgnoreCase(key, JMX_PREFIX))
            {
                config.setJmxOption(value);
            }
            restUrl = restUrl.substring(colonPos + 1);
        }
        config.setRawUrl(restUrl);
        if (config.getRawDriverClassName() == null || config.getRawDriverClassName().isEmpty()) {
            String rawDriverClassname = JdbcUtils.getDriverClassName(restUrl);
            config.setRawDriverClassName(rawDriverClassname);
        }
        config.setUrl(url);
        return config;
    }
@Test
    public void parseConfig() throws Exception {
       // String url = "jdbc:wrap-jdbc:driver=driver1:filters=filters1:name=name1:jmx=true:jdbc:sqlite:";
        Properties properties;
        DataSourceProxyConfig config;
        String url = "";
        //non driver property , getRawDriverClassName() = convert(jdbc:sqlite:) = org.sqlite.JDBC
        url = "jdbc:wrap-jdbc:jdbc:sqlite:";
        properties = new Properties();
        config = DruidDriver.parseConfig(url,properties);
        Assert.assertEquals(config.getRawDriverClassName() , JdbcConstants.SQLITE_DRIVER);
        Assert.assertEquals(config.getRawUrl() , "jdbc:sqlite:");

        //have driver property , getRawDriverClassName() = driver1 , getRawUrl()=jdbc:sqlite:
        url = "jdbc:wrap-jdbc:driver=driver1:filters=com.alibaba.druid.filter.stat.StatFilter,com.alibaba.druid.filter.encoding.EncodingConvertFilter:name=name1:jmx=true:jdbc:sqlite:";
        properties = new Properties();
        config = DruidDriver.parseConfig(url,properties);
        Assert.assertEquals(config.getRawDriverClassName() , "driver1");
        Assert.assertEquals(config.getName() , "name1");
        Assert.assertEquals(config.isJmxOption() , true);
        Assert.assertEquals(config.getRawUrl() , "jdbc:sqlite:");

        //non driver property , getRawDriverClassName() = convert(jdbc:sqlite:) = org.sqlite.JDBC
        url = "jdbc:wrap-jdbc:name=name2:jmx=true:jdbc:sqlite:";
        properties = new Properties();
        config = DruidDriver.parseConfig(url,properties);
        Assert.assertEquals(config.getName() , "name2");
        Assert.assertEquals(config.getRawDriverClassName() , JdbcConstants.SQLITE_DRIVER);
        Assert.assertEquals(config.getRawUrl() , "jdbc:sqlite:");

        //mix properties order, have driver property , getRawDriverClassName() = driver2
        url = "jdbc:wrap-jdbc:jmx=false:name=name2:filters=com.alibaba.druid.filter.stat.StatFilter:driver=driver2:jdbc:sqlite:";
        properties = new Properties();
        config = DruidDriver.parseConfig(url,properties);
        Assert.assertEquals(config.getRawDriverClassName() , "driver2");
        Assert.assertEquals(config.getName() , "name2");
        Assert.assertEquals(config.isJmxOption() , false);
        Assert.assertEquals(config.getRawUrl() , "jdbc:sqlite:");

        //mix properties order, have driver property , getRawDriverClassName() = driver2
        url = "jdbc:wrap-jdbc:jmx=true:name=name2:filters=com.alibaba.druid.filter.stat.StatFilter:driver=driver2:jdbc:sqlite:";
        properties = new Properties();
        config = DruidDriver.parseConfig(url,properties);
        Assert.assertEquals(config.getRawDriverClassName() , "driver2");
        Assert.assertEquals(config.getName() , "name2");
        Assert.assertEquals(config.isJmxOption() , true);
        Assert.assertEquals(config.getRawUrl() , "jdbc:sqlite:");

        url = "jdbc:wrap-jdbc:filters=default,commonLogging,log4j:name=basicType:jdbc:derby:memory:basicTypeTestDB;create=true";
        properties = new Properties();
        config = DruidDriver.parseConfig(url,properties);
        Assert.assertEquals(config.getRawDriverClassName() , "org.apache.derby.jdbc.EmbeddedDriver");
        Assert.assertEquals(config.getName() , "basicType");
        Assert.assertEquals(config.isJmxOption() , false);
        Assert.assertEquals(config.getRawUrl() , "jdbc:derby:memory:basicTypeTestDB;create=true");

        url = "jdbc:wrap-jdbc:jmx=true:filters=default,commonLogging,log4j:name=mydsqlds:jdbc:mysql://127.0.0.1:3306/test?useInformationSchema=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=utf-8";
        properties = new Properties();
        config = DruidDriver.parseConfig(url,properties);
        Assert.assertEquals(config.getRawDriverClassName() , "com.mysql.cj.jdbc.Driver");
        Assert.assertEquals(config.getName() , "mydsqlds");
        Assert.assertEquals(config.isJmxOption() , true);
        Assert.assertEquals(config.getRawUrl() , "jdbc:mysql://127.0.0.1:3306/test?useInformationSchema=true&serverTimezone=Asia/Shanghai&allowMultiQueries=true&characterEncoding=utf-8");



    }