use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class CloudJobConfigurationListenerTest method assertChildEventWhenStateIsUpdateAndIsConfigPathAndTransientJob.
@Test
public void assertChildEventWhenStateIsUpdateAndIsConfigPathAndTransientJob() throws Exception {
cloudJobConfigurationListener.childEvent(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/config/job/test_job", null, CloudJsonConstants.getJobJson().getBytes())));
verify(readyService, times(0)).remove(Collections.singletonList("test_job"));
verify(producerManager).reschedule(Matchers.<CloudJobConfiguration>any());
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class CloudJobConfigurationListenerTest method assertChildEventWhenIsNotConfigPath.
@Test
public void assertChildEventWhenIsNotConfigPath() throws Exception {
cloudJobConfigurationListener.childEvent(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_UPDATED, new ChildData("/other/test_job", null, "".getBytes())));
verify(producerManager, times(0)).schedule(Matchers.<CloudJobConfiguration>any());
verify(producerManager, times(0)).reschedule(Matchers.<CloudJobConfiguration>any());
verify(producerManager, times(0)).unschedule(Matchers.<String>any());
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class CloudJobConfigurationListenerTest method assertChildEventWhenStateIsAddAndIsConfigPathAndInvalidData.
@Test
public void assertChildEventWhenStateIsAddAndIsConfigPathAndInvalidData() throws Exception {
cloudJobConfigurationListener.childEvent(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/config/job/test_job", null, "".getBytes())));
verify(producerManager, times(0)).schedule(Matchers.<CloudJobConfiguration>any());
verify(producerManager, times(0)).reschedule(Matchers.<CloudJobConfiguration>any());
verify(producerManager, times(0)).unschedule(Matchers.<String>any());
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ExecutionListenerManagerTest method assertMonitorExecutionChangedJobListenerWhenIsNotMonitorExecutionPath.
@Test
public void assertMonitorExecutionChangedJobListenerWhenIsNotMonitorExecutionPath() {
executionListenerManager.new MonitorExecutionChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config/other", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config/other");
verify(executionService, times(0)).removeExecutionInfo();
}
use of org.apache.curator.framework.recipes.cache.TreeCacheEvent in project elastic-job by dangdangdotcom.
the class ExecutionListenerManagerTest method assertMonitorExecutionChangedJobListenerWhenIsMonitorExecutionPathButNotUpdate.
@Test
public void assertMonitorExecutionChangedJobListenerWhenIsMonitorExecutionPathButNotUpdate() {
executionListenerManager.new MonitorExecutionChangedJobListener().dataChanged(null, new TreeCacheEvent(TreeCacheEvent.Type.NODE_ADDED, new ChildData("/test_job/config", null, LiteJsonConstants.getJobJson().getBytes())), "/test_job/config");
verify(executionService, times(0)).removeExecutionInfo();
}
Aggregations