Search in sources :

Example 1 with MigrationEventTbl

use of com.ctrip.xpipe.redis.console.model.MigrationEventTbl in project x-pipe by ctripcorp.

the class MigrationServiceTest method createTest.

@Test
@DirtiesContext
public void createTest() throws ComponentLookupException {
    long eventId = migrationService.createMigrationEvent(createEventDemo(1, 2));
    MigrationEventTbl result = migrationService.find(eventId);
    MigrationClusterTbl result_cluster = migrationService.findMigrationCluster(eventId, 1);
    ClusterTbl cluster = clusterService.find(1);
    List<MigrationShardTbl> result_shards = migrationService.findMigrationShards(result_cluster.getId());
    Assert.assertEquals(eventId, result.getId());
    Assert.assertEquals("unit test", result.getOperator());
    Assert.assertNotNull(result_cluster);
    Assert.assertEquals(1, result_cluster.getClusterId());
    Assert.assertEquals(2, result_cluster.getDestinationDcId());
    Assert.assertEquals(MigrationStatus.Initiated.toString(), result_cluster.getStatus());
    Assert.assertEquals(ClusterStatus.Lock.toString(), cluster.getStatus());
    Assert.assertEquals(2, result_shards.size());
}
Also used : MigrationClusterTbl(com.ctrip.xpipe.redis.console.model.MigrationClusterTbl) ClusterTbl(com.ctrip.xpipe.redis.console.model.ClusterTbl) MigrationClusterTbl(com.ctrip.xpipe.redis.console.model.MigrationClusterTbl) MigrationShardTbl(com.ctrip.xpipe.redis.console.model.MigrationShardTbl) MigrationEventTbl(com.ctrip.xpipe.redis.console.model.MigrationEventTbl) AbstractConsoleIntegrationTest(com.ctrip.xpipe.redis.console.AbstractConsoleIntegrationTest) Test(org.junit.Test) DirtiesContext(org.springframework.test.annotation.DirtiesContext)

Aggregations

AbstractConsoleIntegrationTest (com.ctrip.xpipe.redis.console.AbstractConsoleIntegrationTest)1 ClusterTbl (com.ctrip.xpipe.redis.console.model.ClusterTbl)1 MigrationClusterTbl (com.ctrip.xpipe.redis.console.model.MigrationClusterTbl)1 MigrationEventTbl (com.ctrip.xpipe.redis.console.model.MigrationEventTbl)1 MigrationShardTbl (com.ctrip.xpipe.redis.console.model.MigrationShardTbl)1 Test (org.junit.Test)1 DirtiesContext (org.springframework.test.annotation.DirtiesContext)1