Search in sources :

Example 1 with ClusterConfigImpl

use of com.ctrip.framework.dal.cluster.client.config.ClusterConfigImpl in project dal by ctripcorp.

the class DummyDatabaseTest method setUp.

@Before
public void setUp() throws Exception {
    clusterConfig = new ClusterConfigImpl("name", DatabaseCategory.CUSTOM, 12);
    shardConfig = new DatabaseShardConfigImpl(clusterConfig, 0);
    shardConfig.setMasterDomain(MASTER_DOMAIN);
    shardConfig.setSlaveDomain(SLAVE_DOMAIN);
    databaseConfig = new DatabaseConfigImpl(shardConfig);
    dummyDatabase = new DummyDatabase(databaseConfig);
}
Also used : DatabaseShardConfigImpl(com.ctrip.framework.dal.cluster.client.config.DatabaseShardConfigImpl) DatabaseConfigImpl(com.ctrip.framework.dal.cluster.client.config.DatabaseConfigImpl) ClusterConfigImpl(com.ctrip.framework.dal.cluster.client.config.ClusterConfigImpl) Before(org.junit.Before)

Example 2 with ClusterConfigImpl

use of com.ctrip.framework.dal.cluster.client.config.ClusterConfigImpl in project dal by ctripcorp.

the class ClusterDataBaseAdapterTest method setUp.

@Before
public void setUp() throws Exception {
    clusterConfig = new ClusterConfigImpl(CLUSTER_NAME, DatabaseCategory.CUSTOM, 12);
    databaseShardConfig = new DatabaseShardConfigImpl(clusterConfig, 0);
    databaseShardConfig.setMasterDomain(MASTER_DOMAIN);
    databaseShardConfig.setSlaveDomain(SLAVE_DOMAIN);
    databaseConfig = new DatabaseConfigImpl(databaseShardConfig);
    databaseShardConfig.addDatabaseConfig(databaseConfig);
    clusterConfig.addDatabaseShardConfig(databaseShardConfig);
    cluster = clusterConfig.generate();
    clusterDataBaseAdapter = new ClusterDataBaseAdapter(cluster);
}
Also used : DatabaseShardConfigImpl(com.ctrip.framework.dal.cluster.client.config.DatabaseShardConfigImpl) DatabaseConfigImpl(com.ctrip.framework.dal.cluster.client.config.DatabaseConfigImpl) ClusterConfigImpl(com.ctrip.framework.dal.cluster.client.config.ClusterConfigImpl) Before(org.junit.Before)

Aggregations

ClusterConfigImpl (com.ctrip.framework.dal.cluster.client.config.ClusterConfigImpl)2 DatabaseConfigImpl (com.ctrip.framework.dal.cluster.client.config.DatabaseConfigImpl)2 DatabaseShardConfigImpl (com.ctrip.framework.dal.cluster.client.config.DatabaseShardConfigImpl)2 Before (org.junit.Before)2