use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class FailoverListenerManagerTest method assertFailoverSettingsChangedJobListenerWhenIsNotFailoverPath.
@Test
public void assertFailoverSettingsChangedJobListenerWhenIsNotFailoverPath() {
failoverListenerManager.new FailoverSettingsChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config/other", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config/other");
verify(failoverService, times(0)).removeFailoverInfo();
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class JobOperationListenerManagerTest method assertJobShutdownStatusJobListenerWhenIsJobShutdownPathAndAdd.
@Test
public void assertJobShutdownStatusJobListenerWhenIsJobShutdownPathAndAdd() {
JobRegistry.getInstance().addJobScheduleController("test_job", jobScheduleController);
jobOperationListenerManager.new JobShutdownStatusJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/servers/" + ip + "/shutdown", null, "".getBytes())), "/test_job/servers/" + ip + "/shutdown");
verify(jobScheduleController).shutdown();
verify(serverService).processServerShutdown();
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ShardingListenerManagerTest method assertShardingTotalCountChangedJobListenerWhenIsConfigPathButCurrentShardingTotalCountIsZero.
@Test
public void assertShardingTotalCountChangedJobListenerWhenIsConfigPathButCurrentShardingTotalCountIsZero() {
shardingListenerManager.new ShardingTotalCountChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config");
verify(shardingService, times(0)).setReshardingFlag();
verify(executionService, times(0)).setNeedFixExecutionInfoFlag();
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ShardingListenerManagerTest method assertShardingTotalCountChangedJobListenerWhenIsNotConfigPath.
@Test
public void assertShardingTotalCountChangedJobListenerWhenIsNotConfigPath() {
shardingListenerManager.new ShardingTotalCountChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config/other", null, "".getBytes())), "/test_job/config/other");
verify(shardingService, times(0)).setReshardingFlag();
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ShardingListenerManagerTest method assertListenServersChangedJobListenerWhenIsNotServerStatusPath.
@Test
public void assertListenServersChangedJobListenerWhenIsNotServerStatusPath() {
shardingListenerManager.new ListenServersChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/servers/" + ip + "/other", null, "".getBytes())), "/test_job/servers/" + ip + "/other");
verify(shardingService, times(0)).setReshardingFlag();
}
Aggregations