use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class JobOperationListenerManagerTest method assertJobPausedStatusJobListenerWhenIsJobPausedPathAndRemove.
@Test
public void assertJobPausedStatusJobListenerWhenIsJobPausedPathAndRemove() {
JobRegistry.getInstance().addJobScheduleController("test_job", jobScheduleController);
jobOperationListenerManager.new JobPausedStatusJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_REMOVED, new ChildData("/test_job/servers/" + ip + "/paused", null, "".getBytes())), "/test_job/servers/" + ip + "/paused");
verify(jobScheduleController, times(0)).pauseJob();
verify(jobScheduleController).resumeJob();
verify(serverService).clearJobPausedStatus();
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class JobOperationListenerManagerTest method assertJobPausedStatusJobListenerWhenIsJobPausedPathButJobIsNotExisted.
@Test
public void assertJobPausedStatusJobListenerWhenIsJobPausedPathButJobIsNotExisted() {
jobOperationListenerManager.new JobPausedStatusJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/servers/" + ip + "/paused", null, "".getBytes())), "/test_job/servers/" + ip + "/paused");
verify(jobScheduleController, times(0)).pauseJob();
verify(jobScheduleController, times(0)).resumeJob();
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ConfigurationListenerManagerTest method assertCronSettingChangedJobListenerWhenIsNotCronPath.
@Test
public void assertCronSettingChangedJobListenerWhenIsNotCronPath() {
configurationListenerManager.new CronSettingAndJobEventChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config/other", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config/other");
verify(jobScheduleController, times(0)).rescheduleJob(Matchers.<String>any());
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ConfigurationListenerManagerTest method assertCronSettingChangedJobListenerWhenIsCronPathButNotUpdate.
@Test
public void assertCronSettingChangedJobListenerWhenIsCronPathButNotUpdate() {
configurationListenerManager.new CronSettingAndJobEventChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config");
verify(jobScheduleController, times(0)).rescheduleJob(Matchers.<String>any());
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ConfigurationListenerManagerTest method assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateAndFindJob.
@Test
public void assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateAndFindJob() {
JobRegistry.getInstance().addJobScheduleController("test_job", jobScheduleController);
configurationListenerManager.new CronSettingAndJobEventChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/test_job/config", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config");
verify(jobScheduleController).rescheduleJob("0/1 * * * * ?");
}
Aggregations