use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class ConfigurationListenerManagerTest method assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateButCannotFindJob.
@Test
public void assertCronSettingChangedJobListenerWhenIsCronPathAndUpdateButCannotFindJob() {
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, times(0)).rescheduleJob(Matchers.<String>any());
}
use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class GuaranteeListenerManagerTest method assertCompletedNodeRemovedJobListenerWhenIsNotRemoved.
@Test
public void assertCompletedNodeRemovedJobListenerWhenIsNotRemoved() {
guaranteeListenerManager.new CompletedNodeRemovedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/test_job/guarantee/completed", null, "".getBytes())), "/test_job/guarantee/completed");
verify(distributeOnceElasticJobListener, times(0)).notifyWaitingTaskStart();
}
use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class GuaranteeListenerManagerTest method assertStartedNodeRemovedJobListenerWhenIsRemovedAndStartedNode.
@Test
public void assertStartedNodeRemovedJobListenerWhenIsRemovedAndStartedNode() {
guaranteeListenerManager.new StartedNodeRemovedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_REMOVED, new ChildData("/test_job/guarantee/started", null, "".getBytes())), "/test_job/guarantee/started");
verify(distributeOnceElasticJobListener).notifyWaitingTaskStart();
}
use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class JobListenerTest method assertChildEventSuccess.
@Test
public void assertChildEventSuccess() throws Exception {
when(event.getData()).thenReturn(new ChildData("/test_job", null, null));
fooJobListener.childEvent(client, event);
verify(client).getNamespace();
}
use of org.apache.curator.framework.recipes.cache.ChildData in project elastic-job by dangdangdotcom.
the class FailoverListenerManagerTest method assertFailoverSettingsChangedJobListenerWhenIsFailoverPathButNotUpdate.
@Test
public void assertFailoverSettingsChangedJobListenerWhenIsFailoverPathButNotUpdate() {
failoverListenerManager.new FailoverSettingsChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config/failover", null, "".getBytes())), "/test_job/config/failover");
verify(failoverService, times(0)).removeFailoverInfo();
}
Aggregations