Search in sources :

Example 11 with DbClientContext

use of com.emc.storageos.db.client.impl.DbClientContext in project coprhd-controller by CoprHD.

the class DbIndexTest method createClient.

private DbClientTest.DbClientImplUnitTester createClient() {
    DbClientTest.DbClientImplUnitTester dbClient = new DbClientTest.DbClientImplUnitTester();
    dbClient.setCoordinatorClient(_coordinator);
    dbClient.setDbVersionInfo(sourceVersion);
    dbClient.setBypassMigrationLock(true);
    _encryptionProvider.setCoordinator(_coordinator);
    dbClient.setEncryptionProvider(_encryptionProvider);
    DbClientContext localCtx = new DbClientContext();
    localCtx.setClusterName("Test");
    localCtx.setKeyspaceName("Test");
    dbClient.setLocalContext(localCtx);
    return dbClient;
}
Also used : DbClientContext(com.emc.storageos.db.client.impl.DbClientContext)

Example 12 with DbClientContext

use of com.emc.storageos.db.client.impl.DbClientContext in project coprhd-controller by CoprHD.

the class DbsvcTestBase method getDbClientBase.

protected static InternalDbClient getDbClientBase(InternalDbClient dbClient) {
    dbClient.setCoordinatorClient(_coordinator);
    dbClient.setDbVersionInfo(sourceVersion);
    dbClient.setBypassMigrationLock(true);
    _encryptionProvider.setCoordinator(_coordinator);
    dbClient.setEncryptionProvider(_encryptionProvider);
    DbClientContext localCtx = new MockDbClientContext();
    localCtx.setClusterName("Test");
    localCtx.setKeyspaceName("Test");
    dbClient.setLocalContext(localCtx);
    dbClient.setDrUtil(new DrUtil(_coordinator));
    VdcUtil.setDbClient(dbClient);
    return dbClient;
}
Also used : DbClientContext(com.emc.storageos.db.client.impl.DbClientContext) DrUtil(com.emc.storageos.coordinator.client.service.DrUtil)

Example 13 with DbClientContext

use of com.emc.storageos.db.client.impl.DbClientContext in project coprhd-controller by CoprHD.

the class LazyLoadTests method setupTest.

@Before
public void setupTest() {
    DbClientImplUnitTester dbClient = new DbClientImplUnitTester();
    dbClient.setCoordinatorClient(_coordinator);
    dbClient.setDbVersionInfo(sourceVersion);
    dbClient.setBypassMigrationLock(true);
    _encryptionProvider.setCoordinator(_coordinator);
    dbClient.setEncryptionProvider(_encryptionProvider);
    DbClientContext localCtx = new DbClientContext();
    localCtx.setClusterName("Test");
    localCtx.setKeyspaceName("Test");
    dbClient.setLocalContext(localCtx);
    VdcUtil.setDbClient(dbClient);
    dbClient.setBypassMigrationLock(false);
    dbClient.setDrUtil(new DrUtil(_coordinator));
    dbClient.start();
    _dbClient = dbClient;
    modelClient = new DbModelClientImpl(_dbClient);
}
Also used : DbClientContext(com.emc.storageos.db.client.impl.DbClientContext) DbModelClientImpl(com.emc.storageos.db.client.impl.DbModelClientImpl) DbClientImplUnitTester(com.emc.storageos.db.server.DbClientTest.DbClientImplUnitTester) DrUtil(com.emc.storageos.coordinator.client.service.DrUtil) Before(org.junit.Before)

Example 14 with DbClientContext

use of com.emc.storageos.db.client.impl.DbClientContext in project coprhd-controller by CoprHD.

the class DBClientTestBase method createDbClient.

/**
 * Create DbClient to embedded DB
 *
 * @return
 */
protected static DbClient createDbClient() {
    ENCRYPTION_PROVIDER.setCoordinator(ModelTestSuite.getCoordinator());
    DbClientContext localCtx = new DbClientContext();
    localCtx.setClusterName("Test");
    localCtx.setKeyspaceName("Test");
    DbClientImpl dbClient = new DbClientImpl();
    dbClient.setCoordinatorClient(ModelTestSuite.getCoordinator());
    dbClient.setEncryptionProvider(ENCRYPTION_PROVIDER);
    dbClient.setBypassMigrationLock(true);
    dbClient.setDbVersionInfo(ModelTestSuite.getDbVersionInfo());
    dbClient.setLocalContext(localCtx);
    VdcUtil.setDbClient(dbClient);
    dbClient.start();
    return dbClient;
}
Also used : DbClientContext(com.emc.storageos.db.client.impl.DbClientContext) DbClientImpl(com.emc.storageos.db.client.impl.DbClientImpl)

Example 15 with DbClientContext

use of com.emc.storageos.db.client.impl.DbClientContext in project coprhd-controller by CoprHD.

the class PlacementTests method setupTest.

@Before
public void setupTest() {
    DbClientImplUnitTester dbClient = new DbClientImplUnitTester();
    dbClient.setCoordinatorClient(_coordinator);
    dbClient.setDbVersionInfo(sourceVersion);
    dbClient.setBypassMigrationLock(true);
    _encryptionProvider.setCoordinator(_coordinator);
    dbClient.setEncryptionProvider(_encryptionProvider);
    DbClientContext localCtx = new DbClientContext();
    localCtx.setClusterName("Test");
    localCtx.setKeyspaceName("Test");
    dbClient.setLocalContext(localCtx);
    VdcUtil.setDbClient(dbClient);
    dbClient.setBypassMigrationLock(false);
    dbClient.start();
    _dbClient = dbClient;
}
Also used : DbClientContext(com.emc.storageos.db.client.impl.DbClientContext) DbClientImplUnitTester(com.emc.storageos.db.server.DbClientTest.DbClientImplUnitTester) Before(org.junit.Before)

Aggregations

DbClientContext (com.emc.storageos.db.client.impl.DbClientContext)17 DrUtil (com.emc.storageos.coordinator.client.service.DrUtil)4 Before (org.junit.Before)4 DbVersionInfo (com.emc.storageos.coordinator.client.model.DbVersionInfo)3 DbClientImpl (com.emc.storageos.db.client.impl.DbClientImpl)3 DbClientImplUnitTester (com.emc.storageos.db.server.DbClientTest.DbClientImplUnitTester)3 CoordinatorClientInetAddressMap (com.emc.storageos.coordinator.client.service.impl.CoordinatorClientInetAddressMap)2 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)2 IOException (java.io.IOException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 SiteInfo (com.emc.storageos.coordinator.client.model.SiteInfo)1 CoordinatorClient (com.emc.storageos.coordinator.client.service.CoordinatorClient)1 CoordinatorClientImpl (com.emc.storageos.coordinator.client.service.impl.CoordinatorClientImpl)1 DualInetAddress (com.emc.storageos.coordinator.client.service.impl.DualInetAddress)1 Configuration (com.emc.storageos.coordinator.common.Configuration)1 ConfigurationImpl (com.emc.storageos.coordinator.common.impl.ConfigurationImpl)1 ServiceImpl (com.emc.storageos.coordinator.common.impl.ServiceImpl)1 ZkConnection (com.emc.storageos.coordinator.common.impl.ZkConnection)1 CoordinatorException (com.emc.storageos.coordinator.exceptions.CoordinatorException)1 FatalCoordinatorException (com.emc.storageos.coordinator.exceptions.FatalCoordinatorException)1