use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class JobOperationListenerManagerTest method assertJobPausedStatusJobListenerWhenIsNotJobPausedPath.
@Test
public void assertJobPausedStatusJobListenerWhenIsNotJobPausedPath() {
jobOperationListenerManager.new JobPausedStatusJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/test_job/servers/" + ip + "/other", null, "".getBytes())), "/test_job/servers/" + ip + "/other");
verify(jobScheduleController, times(0)).pauseJob();
verify(jobScheduleController, times(0)).resumeJob();
}
use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class JobOperationListenerManagerTest method assertJobShutdownStatusJobListenerWhenIsJobShutdownPathButJobIsNotExisted.
@Test
public void assertJobShutdownStatusJobListenerWhenIsJobShutdownPathButJobIsNotExisted() {
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, times(0)).shutdown();
}
use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class JobOperationListenerManagerTest method assertJobTriggerStatusJobListenerWhenIsAddAndIsJobLocalHostTriggerPathAndJobRegisterButServerIsNotReady.
@Test
public void assertJobTriggerStatusJobListenerWhenIsAddAndIsJobLocalHostTriggerPathAndJobRegisterButServerIsNotReady() {
JobRegistry.getInstance().addJobScheduleController("test_job", jobScheduleController);
jobOperationListenerManager.new JobTriggerStatusJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/servers/" + ip + "/trigger", null, "".getBytes())), "/test_job/servers/" + ip + "/trigger");
verify(serverService).clearJobTriggerStatus();
verify(serverService).isLocalhostServerReady();
verify(jobScheduleController, times(0)).triggerJob();
}
use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class JobOperationListenerManagerTest method assertJobTriggerStatusJobListenerWhenIsAddButNotLocalHostJobTriggerPath.
@Test
public void assertJobTriggerStatusJobListenerWhenIsAddButNotLocalHostJobTriggerPath() {
jobOperationListenerManager.new JobTriggerStatusJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/servers/" + ip + "/other", null, "".getBytes())), "/test_job/servers/" + ip + "/other");
verify(serverService, times(0)).clearJobTriggerStatus();
verify(jobScheduleController, times(0)).triggerJob();
}
use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class JobOperationListenerManagerTest method assertJobShutdownStatusJobListenerWhenIsNotJobShutdownPath.
@Test
public void assertJobShutdownStatusJobListenerWhenIsNotJobShutdownPath() {
jobOperationListenerManager.new JobShutdownStatusJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/test_job/servers/" + ip + "/other", null, "".getBytes())), "/test_job/servers/" + ip + "/other");
verify(jobScheduleController, times(0)).shutdown();
}
Aggregations