Commit 249e4225 authored by haocao's avatar haocao
Browse files

Refactor codes.

parent 70117fe7
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@
 * </p>
 */

package io.shardingjdbc.orchestration.api;
package io.shardingjdbc.orchestration.api.util;

import io.shardingjdbc.orchestration.internal.OrchestrationMasterSlaveDataSource;
import io.shardingjdbc.orchestration.internal.OrchestrationShardingDataSource;
@@ -23,11 +23,11 @@ import io.shardingjdbc.orchestration.internal.OrchestrationShardingDataSource;
import javax.sql.DataSource;

/**
 * Orchestration closeable datasource util.
 * Orchestration datasource closeable util.
 *
 * @author caohao
 */
public final class OrchestrationCloseableDataSourceUtil {
public final class OrchestrationDataSourceCloseableUtil {
    
    public static void closeQuietly(final DataSource dataSource) {
        if (dataSource instanceof OrchestrationShardingDataSource) {
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ package io.shardingjdbc.orchestration.yaml.masterslave;
import com.google.common.base.Function;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import io.shardingjdbc.orchestration.api.OrchestrationCloseableDataSourceUtil;
import io.shardingjdbc.orchestration.api.util.OrchestrationDataSourceCloseableUtil;
import io.shardingjdbc.orchestration.api.OrchestrationMasterSlaveDataSourceFactory;
import io.shardingjdbc.orchestration.yaml.AbstractYamlDataSourceTest;
import lombok.RequiredArgsConstructor;
@@ -74,6 +74,6 @@ public class YamlOrchestrationMasterSlaveIntegrateTest extends AbstractYamlDataS
            stm.executeQuery("SELECT * FROM t_order_item");
            stm.executeQuery("SELECT * FROM t_config");
        }
        OrchestrationCloseableDataSourceUtil.closeQuietly(dataSource);
        OrchestrationDataSourceCloseableUtil.closeQuietly(dataSource);
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ package io.shardingjdbc.orchestration.yaml.sharding;
import com.google.common.base.Function;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import io.shardingjdbc.orchestration.api.OrchestrationCloseableDataSourceUtil;
import io.shardingjdbc.orchestration.api.util.OrchestrationDataSourceCloseableUtil;
import io.shardingjdbc.orchestration.api.OrchestrationShardingDataSourceFactory;
import io.shardingjdbc.orchestration.yaml.AbstractYamlDataSourceTest;
import lombok.RequiredArgsConstructor;
@@ -77,6 +77,6 @@ public class YamlOrchestrationShardingIntegrateTest extends AbstractYamlDataSour
            stm.executeQuery("SELECT * FROM t_order_item");
            stm.executeQuery("SELECT * FROM config");
        }
        OrchestrationCloseableDataSourceUtil.closeQuietly(dataSource);
        OrchestrationDataSourceCloseableUtil.closeQuietly(dataSource);
    }
}
+2 −2
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ package io.shardingjdbc.orchestration.yaml.sharding;
import com.google.common.base.Function;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import io.shardingjdbc.orchestration.api.OrchestrationCloseableDataSourceUtil;
import io.shardingjdbc.orchestration.api.util.OrchestrationDataSourceCloseableUtil;
import io.shardingjdbc.orchestration.api.OrchestrationShardingDataSourceFactory;
import io.shardingjdbc.orchestration.yaml.AbstractYamlDataSourceTest;
import lombok.RequiredArgsConstructor;
@@ -84,6 +84,6 @@ public class YamlOrchestrationShardingWithMasterSlaveIntegrateTest extends Abstr
            stm.executeQuery("SELECT * FROM t_order_item");
            stm.executeQuery("SELECT * FROM config");
        }
        OrchestrationCloseableDataSourceUtil.closeQuietly(dataSource);
        OrchestrationDataSourceCloseableUtil.closeQuietly(dataSource);
    }
}